Package com.aowagie.text
Class Row
- java.lang.Object
-
- com.aowagie.text.Row
-
- All Implemented Interfaces:
Element
public class Row extends java.lang.Object implements Element
ARowis part of aTableand contains someCells.All
Rows are constructed by aTable-object. You don't have to construct anyRowyourself. In fact you can't construct aRowoutside the package.Since a
Cellcan span several rows and/or columns a row can contain reserved space without any content.
-
-
Field Summary
Fields Modifier and Type Field Description static intCELLid of the Cell element in a Rowprotected java.lang.Object[]cellsThis is the array of Objects (CellorTable).protected intcolumnsThis is the number of columns in theRow.protected intcurrentColumnThis is a valid position theRow.protected inthorizontalAlignmentThis is the vertical alignment.static intNULLid of a null element in a Rowprotected boolean[]reservedThis is the array that keeps track of reserved cells.static intTABLEid of the Table element in a Row-
Fields inherited from interface com.aowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TITLE, YMARK
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRow(int columns)Constructs aRowwith a certain number of columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intaddElement(java.lang.Object element)Adds aCellto theRow.(package private) intaddElement(java.lang.Object element, int column)Adds an element to theRowat the position given.(package private) voiddeleteColumn(int column)Returns aRowthat is a copy of thisRowin which a certain column has been deleted.java.lang.ObjectgetCell(int column)Gets aCellorTablefrom a certain column.java.util.ArrayListgetChunks()Gets all the chunks in this element.intgetColumns()Gets the number of columns.(package private) intgetElementID(int column)Returns the type-id of the element in a Row.intgetHorizontalAlignment()Gets the horizontal alignment.(package private) intgetObjectID(java.lang.Object element)Returns the type-id of an Object.booleanisContent()Checks if this element is a content object.booleanisEmpty()Checks if the row is empty.booleanisNestable()Checks if this element is nestable.(package private) booleanisReserved(int column)Returns true/false when this position in theRowhas been reserved, either filled or through a colspan of an Element.booleanprocess(ElementListener listener)Processes the element by adding it (or the different parts) to aElementListener.(package private) booleanreserve(int column)Reserves aCellin theRow.(package private) booleanreserve(int column, int size)Reserves aCellin theRow.(package private) voidsetElement(java.lang.Object aElement, int column)PutsCellto theRowat the position given, doesn't reserve colspan.voidsetHorizontalAlignment(int value)Sets the horizontal alignment.inttype()Gets the type of the text element.
-
-
-
Field Detail
-
NULL
public static final int NULL
id of a null element in a Row- See Also:
- Constant Field Values
-
CELL
public static final int CELL
id of the Cell element in a Row- See Also:
- Constant Field Values
-
TABLE
public static final int TABLE
id of the Table element in a Row- See Also:
- Constant Field Values
-
columns
protected int columns
This is the number of columns in theRow.
-
currentColumn
protected int currentColumn
This is a valid position theRow.
-
reserved
protected boolean[] reserved
This is the array that keeps track of reserved cells.
-
cells
protected java.lang.Object[] cells
This is the array of Objects (CellorTable).
-
horizontalAlignment
protected int horizontalAlignment
This is the vertical alignment.
-
-
Method Detail
-
process
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to aElementListener.
-
type
public int type()
Gets the type of the text element.
-
getChunks
public java.util.ArrayList getChunks()
Gets all the chunks in this element.
-
isContent
public boolean isContent()
Description copied from interface:ElementChecks if this element is a content object. If not, it's a metadata object.- Specified by:
isContentin interfaceElement- Returns:
- true if this is a 'content' element; false if this is a 'metadata' element
- Since:
- iText 2.0.8
- See Also:
Element.isContent()
-
isNestable
public boolean isNestable()
Description copied from interface:ElementChecks if this element is nestable.- Specified by:
isNestablein interfaceElement- Returns:
- true if this element can be nested inside other elements.
- Since:
- iText 2.0.8
- See Also:
Element.isNestable()
-
deleteColumn
void deleteColumn(int column)
Returns aRowthat is a copy of thisRowin which a certain column has been deleted.- Parameters:
column- the number of the column to delete
-
addElement
int addElement(java.lang.Object element)
Adds aCellto theRow.- Parameters:
element- the element to add (currently only Cells and Tables supported)- Returns:
- the column position the
Cellwas added, or-1if theelementcouldn't be added.
-
addElement
int addElement(java.lang.Object element, int column)Adds an element to theRowat the position given.- Parameters:
element- the element to add. (currently only Cells and Tables supportedcolumn- the position where to add the cell.- Returns:
- the column position the
Cellwas added, or-1if theCellcouldn't be added.
-
setElement
void setElement(java.lang.Object aElement, int column)PutsCellto theRowat the position given, doesn't reserve colspan.- Parameters:
aElement- the cell to add.column- the position where to add the cell.
-
reserve
boolean reserve(int column)
Reserves aCellin theRow.- Parameters:
column- the column that has to be reserved.- Returns:
trueif the column was reserved,falseif not.
-
reserve
boolean reserve(int column, int size)Reserves aCellin theRow.- Parameters:
column- the column that has to be reserved.size- the number of columns- Returns:
trueif the column was reserved,falseif not.
-
isReserved
boolean isReserved(int column)
Returns true/false when this position in theRowhas been reserved, either filled or through a colspan of an Element.- Parameters:
column- the column.- Returns:
trueif the column was reserved,falseif not.
-
getElementID
int getElementID(int column)
Returns the type-id of the element in a Row.- Parameters:
column- the column of which you'd like to know the type- Returns:
- the type-id of the element in the row
-
getObjectID
int getObjectID(java.lang.Object element)
Returns the type-id of an Object.- Parameters:
element- the object of which you'd like to know the type-id, -1 if invalid- Returns:
- the type-id of an object
-
getCell
public java.lang.Object getCell(int column)
Gets aCellorTablefrom a certain column.- Parameters:
column- the column theCell/Tableis in.- Returns:
- the
Cell,Tableor Object if the column was reserved or null if empty.
-
isEmpty
public boolean isEmpty()
Checks if the row is empty.- Returns:
trueif none of the columns is reserved.
-
getColumns
public int getColumns()
Gets the number of columns.- Returns:
- a value
-
setHorizontalAlignment
public void setHorizontalAlignment(int value)
Sets the horizontal alignment.- Parameters:
value- the new value
-
getHorizontalAlignment
public int getHorizontalAlignment()
Gets the horizontal alignment.- Returns:
- a value
-
-