Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* 
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 */
 
 package org.odftoolkit.simple.table;
 
 import java.util.List;
 
AbstractTableContainer is an abstract implementation of the TableContainer interface, with a default implementation for every method defined in TableContainer , except getTableContainerElement(). Each subclass must implement the abstract method getTableContainerElement().

Since:
0.4.5
 
 public abstract class AbstractTableContainer implements TableContainer {
 
 	private final TableBuilder tableBuilder;
 
 	protected AbstractTableContainer() {
 		 = new Table.TableBuilder(this);
 	}

Add a new Table to this container.

Returns:
added table.
 
 	public Table addTable() {
 		return Table.newTable(this);
 	}

Add a new Table to this container with a specified row number and column number.

The table will be inserted at the end of the tableContainer. An unique table name will be given, you may set a custom table name using the setTableName method.

Parameters:
numRows the row number
numCols the column number
Returns:
a new instance of Table
 
 	public Table addTable(int numRowsint numCols) {
 		return Table.newTable(thisnumRowsnumCols);
 	}

Return an instance of table feature with the specific table name.

Parameters:
name of the table beeing searched for.
Returns:
an instance of table feature with the specific table name.
 
 	public Table getTableByName(String name) {
 		try {
 			OdfElement containerEle = getTableContainerElement();
 			for (int i = 0; i < nodeList.getLength(); i++) {
 				TableTableElement table = (TableTableElementnodeList.item(i);
 				if (table.getOdfAttributeValue(OdfName.newName(."name")).equals(name)) {
 					return getTableBuilder().getTableInstance(table);
 				}
 			}
 		} catch (Exception e) {
 			Logger.getLogger(AbstractTableContainer.class.getName()).log(.nulle);
 		}
 		return null;
 	}

Return a list of table features in this container.

Returns:
a list of table features in this container.
	public List<TablegetTableList() {
		List<TabletableList = new ArrayList<Table>();
		try {
			for (int i = 0; i < nodeList.getLength(); i++) {
			}
catch (Exception e) {
		}
		return tableList;
	}

Return the table builder of this container. Every container has a table builder, which supplies all of the table creation realization, for example newTable().

Returns:
the table builder of this container.
Since:
0.3.5
		return ;
	}
New to GrepCode? Check out our FAQ X