com.java4less.ocr.docparser
Class TextMarkDef

java.lang.Object
  extended by com.java4less.ocr.docparser.TextMarkDef
All Implemented Interfaces:
IReference

public class TextMarkDef
extends java.lang.Object
implements IReference

a text mark (or label) is a constant text or word (or a list of) that will be used as a reference, for example to locate start of sections of values to be read.


Constructor Summary
TextMarkDef(java.lang.String markValue)
           
TextMarkDef(java.lang.String markValue, java.lang.String name)
          creates mark and set name
 
Method Summary
 void addValue(java.lang.String markValue)
          add a value to the list of texts/words
 java.lang.String[] getMarkValues()
          get list of marks
 java.lang.String getName()
          name of label
 TextValue getValue()
          get current value found for this mark
 MatchedValue isMarkInLine(java.lang.String line, int lineIndex)
          check if the line contains the text mark
 void load(org.w3c.dom.Node n)
          load from XML node
 void saveToXml(org.w3c.dom.Document document, org.w3c.dom.Node parent, java.lang.String type)
          save label to XML
 void setName(java.lang.String name)
          name of the label
 void setValue(MatchedValue v)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMarkDef

public TextMarkDef(java.lang.String markValue,
                   java.lang.String name)
creates mark and set name

Parameters:
markValue -
name -

TextMarkDef

public TextMarkDef(java.lang.String markValue)
Method Detail

addValue

public void addValue(java.lang.String markValue)
add a value to the list of texts/words

Parameters:
markValue -

getMarkValues

public java.lang.String[] getMarkValues()
get list of marks

Returns:

isMarkInLine

public MatchedValue isMarkInLine(java.lang.String line,
                                 int lineIndex)
check if the line contains the text mark

Parameters:
line -
Returns:

getValue

public TextValue getValue()
get current value found for this mark

Specified by:
getValue in interface IReference

setValue

public void setValue(MatchedValue v)

getName

public java.lang.String getName()
name of label

Specified by:
getName in interface IReference

setName

public void setName(java.lang.String name)
name of the label

Parameters:
name -

saveToXml

public void saveToXml(org.w3c.dom.Document document,
                      org.w3c.dom.Node parent,
                      java.lang.String type)
               throws java.lang.Exception
save label to XML

Parameters:
document -
parent -
type -
Throws:
java.lang.Exception

load

public void load(org.w3c.dom.Node n)
load from XML node

Parameters:
n -