com.java4less.ocr.docparser.data
Class Section

java.lang.Object
  extended by com.java4less.ocr.docparser.data.Section

public class Section
extends java.lang.Object

an instance of a section in the document


Constructor Summary
Section()
           
 
Method Summary
 void addField(Field f)
          add field in section
 void addLine(java.lang.String s)
          add text line to the section
 java.lang.String getContent()
          get content of the section
 SectionDef getDefinition()
          get definition object
 int getEndLine()
          index of last line of the section
 Field getField(int index)
          get field by index
 java.lang.String getField(java.lang.String name)
          get value of field in section
 int getFieldCount()
          number of fields in section
 java.lang.String[] getLines()
          get content of the secion as an array of lines
 java.lang.String getName()
          name of the section
 int getRepetition()
          current repetition of the section
 int getStartLine()
          index of first line of the section
 void setDefinition(SectionDef definition)
           
 void setEndLine(int endLine)
          index of last line of the section
 void setRepetition(int repetition)
           
 void setStartLine(int startLine)
          index of first line of the section
 void toXml(org.w3c.dom.Document doc, org.w3c.dom.Node sectioNode)
          convert to xml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Section

public Section()
Method Detail

getName

public java.lang.String getName()
name of the section

Returns:

getContent

public java.lang.String getContent()
get content of the section

Returns:

getLines

public java.lang.String[] getLines()
get content of the secion as an array of lines

Returns:

getFieldCount

public int getFieldCount()
number of fields in section

Returns:

getField

public Field getField(int index)
get field by index

Parameters:
index -
Returns:

getField

public java.lang.String getField(java.lang.String name)
get value of field in section


toXml

public void toXml(org.w3c.dom.Document doc,
                  org.w3c.dom.Node sectioNode)
           throws java.lang.Exception
convert to xml

Parameters:
doc -
node -
Throws:
java.lang.Exception

getDefinition

public SectionDef getDefinition()
get definition object

Returns:

setDefinition

public void setDefinition(SectionDef definition)

getStartLine

public int getStartLine()
index of first line of the section

Returns:

setStartLine

public void setStartLine(int startLine)
index of first line of the section

Parameters:
startLine -

getEndLine

public int getEndLine()
index of last line of the section

Returns:

setEndLine

public void setEndLine(int endLine)
index of last line of the section

Parameters:
endLine -

addLine

public void addLine(java.lang.String s)
add text line to the section

Parameters:
s -

addField

public void addField(Field f)
add field in section

Parameters:
f -

getRepetition

public int getRepetition()
current repetition of the section

Returns:

setRepetition

public void setRepetition(int repetition)