de.fu_berlin.ties.text
Class TokenDetails

java.lang.Object
  extended by de.fu_berlin.ties.text.TokenDetails
Direct Known Subclasses:
ContextDetails

public class TokenDetails
extends Object

Stores details on a token in a document.

Version:
$Revision: 1.7 $, $Date: 2006/10/21 16:04:25 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
TokenDetails(String theToken, int tokenRep, int tokenIndex, boolean wsBefore)
          Creates a new instance.
 
Method Summary
 int getIndex()
          Returns the index of the token in the original text (indexing starts with 0).
 int getRep()
          Returns the repetition of the token in the original text (counting starts with 0, as the first occurrence is the "0th repetition").
 String getToken()
          Returns the token itself.
 boolean isWhitespaceBefore()
          Whether there is whitespace before the token.
 void setRep(int newRep)
          Modifies the repetition of the token in the original text (counting starts with 0, as the first occurrence is the "0th repetition").
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenDetails

public TokenDetails(String theToken,
                    int tokenRep,
                    int tokenIndex,
                    boolean wsBefore)
Creates a new instance.

Parameters:
theToken - the token to represent
tokenRep - the repetition of the token in the document (counting starts with 0, as the first occurrence is the "0th repetition")
tokenIndex - the index of the token in the document (counting starts with 0 for the very first token)
wsBefore - whether there is whitespace before the main token (either at the end of left or in the preceding element)
Method Detail

getIndex

public int getIndex()
Returns the index of the token in the original text (indexing starts with 0).

Returns:
the value of the attribute

getRep

public int getRep()
Returns the repetition of the token in the original text (counting starts with 0, as the first occurrence is the "0th repetition").

Returns:
the value of the attribute

getToken

public String getToken()
Returns the token itself.

Returns:
the value of the attribute

isWhitespaceBefore

public boolean isWhitespaceBefore()
Whether there is whitespace before the token.

Returns:
the value of the attribute

setRep

public void setRep(int newRep)
Modifies the repetition of the token in the original text (counting starts with 0, as the first occurrence is the "0th repetition").

Parameters:
newRep - the new value of the attribute

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.