adams.core.io
Class AbstractPdfProclet.DocumentState

java.lang.Object
  extended by adams.core.io.AbstractPdfProclet.DocumentState
All Implemented Interfaces:
Serializable
Enclosing class:
AbstractPdfProclet

public static class AbstractPdfProclet.DocumentState
extends Object
implements Serializable

Container class for storing state information about the document currently being processed.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  int m_CurrentFiles
          the files added since last page break.
protected  boolean m_NewPageAdded
          whether a new page got added.
protected  int m_TotalFiles
          the files added so far.
 
Constructor Summary
AbstractPdfProclet.DocumentState()
          Initializes the state.
 
Method Summary
 void addFile()
          Increments the file counters.
 void contentAdded()
          Stores that content was added.
 boolean isNewPage()
          Returns whether a new page was just added.
 boolean newPage(com.itextpdf.text.Document doc)
          Adds a new page only if none has been added so far.
 void newPageAdded()
          Stores that a new page got added.
 int numCurrentFiles()
          Returns the number of files that have been added since the last page break.
 int numTotalFiles()
          Returns the number of files that have been added so far.
 void resetCurrentFiles()
          Resets the counter for the current files.
 String toString()
          Returns a short representation of the document state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_NewPageAdded

protected boolean m_NewPageAdded
whether a new page got added.


m_TotalFiles

protected int m_TotalFiles
the files added so far.


m_CurrentFiles

protected int m_CurrentFiles
the files added since last page break.

Constructor Detail

AbstractPdfProclet.DocumentState

public AbstractPdfProclet.DocumentState()
Initializes the 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

toString

public String toString()
Returns a short representation of the document state.

Overrides:
toString in class Object
Returns:
the representation


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.