Class DocumentState
- java.lang.Object
-
- adams.flow.transformer.pdfproclet.DocumentState
-
- All Implemented Interfaces:
Serializable
public class DocumentState extends Object implements Serializable
Container class for storing state information about the document currently being processed.- Version:
- $Revision: 13473 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_CurrentFilesthe files added since last page break.protected booleanm_NewPageAddedwhether a new page got added.protected intm_TotalFilesthe files added so far.
-
Constructor Summary
Constructors Constructor Description DocumentState()Initializes the state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFile()Increments the file counters.voidcontentAdded()Stores that content was added.booleanisNewPage()Returns whether a new page was just added.booleannewPage(com.itextpdf.text.Document doc)Adds a new page only if none has been added so far.voidnewPageAdded()Stores that a new page got added.intnumCurrentFiles()Returns the number of files that have been added since the last page break.intnumTotalFiles()Returns the number of files that have been added so far.voidresetCurrentFiles()Resets the counter for the current files.StringtoString()Returns a short representation of the document state.
-
-
-
Method Detail
-
newPage
public boolean newPage(com.itextpdf.text.Document doc)
Adds a new page only if none has been added so far.- Parameters:
doc- the document to add the page to- Returns:
- true if successfully added (or not necessary)
-
newPageAdded
public void newPageAdded()
Stores that a new page got added.
-
contentAdded
public void contentAdded()
Stores that content was added.
-
isNewPage
public boolean isNewPage()
Returns whether a new page was just added.- Returns:
- true if a new page was just added
-
addFile
public void addFile()
Increments the file counters.
-
resetCurrentFiles
public void resetCurrentFiles()
Resets the counter for the current files.
-
numTotalFiles
public int numTotalFiles()
Returns the number of files that have been added so far.- Returns:
- the number of files
-
numCurrentFiles
public int numCurrentFiles()
Returns the number of files that have been added since the last page break.- Returns:
- the number of files
-
-