edu.stanford.nlp.util
Class IString

java.lang.Object
  extended by edu.stanford.nlp.util.IString
All Implemented Interfaces:
HasWord, HasIntegerIdentity, Serializable, CharSequence

public class IString
extends Object
implements CharSequence, Serializable, HasIntegerIdentity, HasWord

Represents a String with a corresponding integer ID. Keeps a static index of all the Strings, indexed by ID.

Author:
danielcer
See Also:
Serialized Form

Field Summary
 int id
           
static IndexInterface<String> index
           
 
Constructor Summary
IString()
           
IString(int id)
           
IString(String string)
           
 
Method Summary
 char charAt(int index)
           
 boolean equals(Object o)
           
 int getId()
           
static String getString(int id)
           
 int hashCode()
           
static IndexInterface<IString> identityIndex()
           
 int length()
           
 long longHashCode()
           
 void setWord(String word)
          Set the word value for the label (if one is stored).
 CharSequence subSequence(int start, int end)
           
 String toString()
           
 String word()
          Return the word value of the label (or null if none).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

index

public static final IndexInterface<String> index

id

public final int id
Constructor Detail

IString

public IString()

IString

public IString(String string)
Parameters:
string -

IString

public IString(int id)
Parameters:
id -
Method Detail

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence

length

public int length()
Specified by:
length in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence

equals

public boolean equals(Object o)
Overrides:
equals in class Object

longHashCode

public long longHashCode()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object

getId

public int getId()
Specified by:
getId in interface HasIntegerIdentity

getString

public static String getString(int id)

word

public String word()
Description copied from interface: HasWord
Return the word value of the label (or null if none).

Specified by:
word in interface HasWord
Returns:
String the word value for the label

setWord

public void setWord(String word)
Description copied from interface: HasWord
Set the word value for the label (if one is stored).

Specified by:
setWord in interface HasWord
Parameters:
word - The word value for the label

identityIndex

public static IndexInterface<IString> identityIndex()


Stanford NLP Group