org.cdlib.xtf.textEngine
Class BoundedMarkPos

Object
  extended by MarkPos
      extended by BasicMarkPos
          extended by BoundedMarkPos
All Implemented Interfaces:
Cloneable

public class BoundedMarkPos
extends BasicMarkPos

Helps with marking fields that contain bump markers.

Author:
Martin Haye

Nested Class Summary
static class BoundedMarkPos.UnmarkableException
          Exception thrown if asked to mark past XML elements or attributes
 
Field Summary
private  Token[] tokens
           
private  int tokNum
           
 
Fields inherited from class BasicMarkPos
charPos, fullText, wordPos
 
Constructor Summary
BoundedMarkPos(Token[] tokens)
          Creates a new mark pos
 
Method Summary
 String getTextTo(MarkPos other, boolean checkUnmarkable)
          Ensures that no XML elements or attributes are accidentally included in the text.
(package private)  void setTokNum(int tokNum)
          Establishes the token number of this mark pos
 void stripMarkers(int termEnd)
          Called by BoundedWordIter when called to get the END_PLUS of a token.
 
Methods inherited from class BasicMarkPos
countTextTo, getTextTo, wordPos
 
Methods inherited from class MarkPos
clone
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokens

private Token[] tokens

tokNum

private int tokNum
Constructor Detail

BoundedMarkPos

BoundedMarkPos(Token[] tokens)
Creates a new mark pos

Method Detail

setTokNum

final void setTokNum(int tokNum)
Establishes the token number of this mark pos


getTextTo

public String getTextTo(MarkPos other,
                        boolean checkUnmarkable)
Ensures that no XML elements or attributes are accidentally included in the text. This is because, at the moment, we don't deal with all the complexities of marking across XML tags (and it is very complex.)


stripMarkers

public void stripMarkers(int termEnd)
Called by BoundedWordIter when called to get the END_PLUS of a token. We strip off bump markers, whitespace, and end-of-field markers.