aspose.pdf
Class Cells

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by aspose.pdf.Cells
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Cells
extends java.util.ArrayList

Represents a collection of Cell objects.

Typical usages are the following:

[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); aspose.pdf.Table table1 = new aspose.pdf.Table(); sec1.getParagraphs().add(table1); table1.setColumnWidths("70 2cm"); Row row1 = table1.getRows().add(); Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2"); cell1Row1.setColumnsSpan(2); cell1Row1.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F)); Row row2 = table1.getRows().add(); Cell cell1Row2 = row2.getCells().add("cell1"); cell1Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F)); Cell cell2Row2 = row2.getCells().add("cell2"); cell2Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F,new aspose.pdf.Color("Red"))); pdf1.save(...); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Table ColumnWidths="70 2cm"> <Row> <Cell ColumnsSpan="2"> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>ColumnsSpan = 2</Segment> </Text> </Cell> </Row> <Row> <Cell> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>cell1</Segment> </Text> </Cell> <Cell> <Border> <All LineWidth="0.5" Color="Red"></All> </Border> <Text> <Segment>cell2</Segment> </Text> </Cell> </Row> </Table> </Section> </Pdf>

See Also:
Serialized Form

Constructor Summary
Cells()
          Constructor - initializes a new instance of the Cells class.
 
Method Summary
 Cell add()
          Initializes a new instance of the Cell class and add it to the Cells collection.
 void add(Cell cell)
          Adds a new Cell object into the collection.
 Cell add(java.lang.String cellString)
          Initializes a new instance of the Cell class,adds a string to the new cell object and then add the Cell object to the Cells collection.
 Cell add(java.lang.String cellString, TextInfo textInfo)
          Initializes a new instance of the Cell class and add it to the Cells collection.
 void addCell(Cell cell)
          Adds a new Cell object into the collection.
 void appendToCells(Cell cell)
          append table's cell to cell collection
 void copyTo(Cell[] cellArray, int index)
          Copies the elements to a cells array, starting at a specified array index.
 Cell getCell(int index)
          Gets a Cell object from the collection according to cell index.
 Cell getCell(java.lang.String cellID)
          Gets a Cell object from the collection according to cell ID.
 Row getRow()
          Gets the parent row of this cells collection.
 int indexOf(Cell cell)
          Gets the index of a specified cell in the collection.
 void insert(Cell cellToInsertAfter, Cell newCell)
          Inserts a new Cell object into the collection after specified Cell object.
 void insert(int index, Cell cell)
          Inserts a new Cell object into the collection at specified position.
 void moveAt(Cell cellToMoveAt, Cells newCells)
           
 void remove(Cell cellToRemove)
          Removes a Cell object from the collection.
 void setCell(int index, Cell value)
          Sets a Cell object from the collection according to cell index.
 void setCell(java.lang.String cellID, Cell value)
          Sets a Cell object from the collection according to cell ID.
 void setRow(Row value)
          Sets the parent row of this cells collection.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Cells

public Cells()
Constructor - initializes a new instance of the Cells class.

Method Detail

addCell

public void addCell(Cell cell)
Adds a new Cell object into the collection.

Parameters:
cell - The Cell object to be added.

add

public void add(Cell cell)
Adds a new Cell object into the collection.

Parameters:
cell - The Cell object to be added.

appendToCells

public void appendToCells(Cell cell)
append table's cell to cell collection

Parameters:
cell -

add

public Cell add()
Initializes a new instance of the Cell class and add it to the Cells collection.

Returns:
The new Cell object

add

public Cell add(java.lang.String cellString)
Initializes a new instance of the Cell class,adds a string to the new cell object and then add the Cell object to the Cells collection.

Parameters:
cellString - The string to be added to the cell.
Returns:
The new Cell object.

add

public Cell add(java.lang.String cellString,
                TextInfo textInfo)
Initializes a new instance of the Cell class and add it to the Cells collection. Adds a string with specified text format to the new cell.

Parameters:
cellString - The string to be added to the cell.
textInfo - The TextInfo object that contains text format information
Returns:
The new Cell object.

getRow

public Row getRow()
Gets the parent row of this cells collection.

Returns:
An Row object.

setRow

public void setRow(Row value)
Sets the parent row of this cells collection.

Parameters:
value - A Row object.

getCell

public Cell getCell(int index)
Gets a Cell object from the collection according to cell index.

Parameters:
index - Index number.
Returns:
A Cell object.

setCell

public void setCell(int index,
                    Cell value)
Sets a Cell object from the collection according to cell index.

Parameters:
index - Index number.
value - Cell object.

getCell

public Cell getCell(java.lang.String cellID)
Gets a Cell object from the collection according to cell ID.

Parameters:
cellID - ID name for Cell object.
Returns:
A Cell object.

setCell

public void setCell(java.lang.String cellID,
                    Cell value)
Sets a Cell object from the collection according to cell ID.

Parameters:
cellID - ID name for Cell object.
value - Cell object.

insert

public void insert(int index,
                   Cell cell)
Inserts a new Cell object into the collection at specified position.

Parameters:
index - The zero-based index at which Cell object should be inserted.
cell - The Cell object to be inserted.

insert

public void insert(Cell cellToInsertAfter,
                   Cell newCell)
Inserts a new Cell object into the collection after specified Cell object.

Parameters:
cellToInsertAfter - The Cell object to insert after.
newCell - The Cell object to be inserted.

remove

public void remove(Cell cellToRemove)
Removes a Cell object from the collection.

Parameters:
cellToRemove - The Cell object to be removed.

copyTo

public void copyTo(Cell[] cellArray,
                   int index)
Copies the elements to a cells array, starting at a specified array index.

Parameters:
cellArray - The cells array.
index - The start index.

indexOf

public int indexOf(Cell cell)
Gets the index of a specified cell in the collection.

Parameters:
cell - The specified Cell object.
Returns:
The index value.

moveAt

public void moveAt(Cell cellToMoveAt,
                   Cells newCells)
Parameters:
cellToMoveAt - the cell which begins to be moved , the rest cells will also be moved to the new collection.
newCells - the destination collection where cells to be move to .