de.dfki.lt.tools.tokenizer.output
Class TextUnit

java.lang.Object
  extended byde.dfki.lt.tools.tokenizer.output.TextUnit

public class TextUnit
extends java.lang.Object

This represents a text unit with its tokens.

Version:
$Id: TextUnit.java,v 1.4 2005/04/12 08:47:38 steffen Exp $
Author:
Joerg Steffen, DFKI

Constructor Summary
TextUnit()
          This creates a new instance of TextUnit.
TextUnit(java.util.List someTokens)
          This creates a new instance of TextUnit that contains the given tokens.
 
Method Summary
 int getEndIndex()
          This returns the end index of the text unit.
 int getStartIndex()
          This returns the start index of the text unit.
 java.util.List getTokens()
          This returns the list with the tokens of the text unit.
 void setEndIndex(int anEndIndex)
          This sets the end index of the text unit to anEndIndex.
 void setStartIndex(int aStartIndex)
          This sets the start index of the text unit to aStartIndex.
 void setTokens(java.util.List someTokens)
          This sets the tokens of the text unit to someTokens.
 java.lang.String toString()
          This returns a string representation of the text unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextUnit

public TextUnit()
This creates a new instance of TextUnit.


TextUnit

public TextUnit(java.util.List someTokens)
This creates a new instance of TextUnit that contains the given tokens.

Parameters:
someTokens - a List with Tokens
Method Detail

getStartIndex

public int getStartIndex()
This returns the start index of the text unit.

Returns:
an int

setStartIndex

public void setStartIndex(int aStartIndex)
This sets the start index of the text unit to aStartIndex.

Parameters:
aStartIndex - an int

getEndIndex

public int getEndIndex()
This returns the end index of the text unit.

Returns:
an int

setEndIndex

public void setEndIndex(int anEndIndex)
This sets the end index of the text unit to anEndIndex.

Parameters:
anEndIndex - an int

getTokens

public java.util.List getTokens()
This returns the list with the tokens of the text unit.

Returns:
a List

setTokens

public void setTokens(java.util.List someTokens)
This sets the tokens of the text unit to someTokens. As a side effect, it adjusts the start index and end index of the text unit to the start index of the first token and the end index of the last token.

Parameters:
someTokens - a List

toString

public java.lang.String toString()
This returns a string representation of the text unit.

Returns:
a String