edu.stanford.nlp.util
Class IString
java.lang.Object
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
index
public static final IndexInterface<String> index
id
public final int id
IString
public IString()
IString
public IString(String string)
- Parameters:
string
-
IString
public IString(int id)
- Parameters:
id
-
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