cc.mallet.types
Class LabelsSequence
java.lang.Object
cc.mallet.types.LabelsSequence
- All Implemented Interfaces:
- AlphabetCarrying, Sequence, java.io.Serializable
public class LabelsSequence
- extends java.lang.Object
- implements Sequence, AlphabetCarrying, java.io.Serializable
A simple Sequence
implementation where all of the
elements must be Labels. Provides a convenient type-safe accessor getLabels(int)
.
Instances of LabelsSequence are immutable.
- Author:
- Andrew McCallum mccallum@cs.umass.edu
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LabelsSequence
public LabelsSequence(Labels[] seq)
- Create a LabelsSequence from an array. The array is shallow-copied.
LabelsSequence
public LabelsSequence(LabelSequence seq)
getAlphabet
public Alphabet getAlphabet()
- Specified by:
getAlphabet
in interface AlphabetCarrying
getAlphabets
public Alphabet[] getAlphabets()
- Specified by:
getAlphabets
in interface AlphabetCarrying
size
public int size()
- Specified by:
size
in interface Sequence
get
public java.lang.Object get(int i)
- Specified by:
get
in interface Sequence
getLabels
public Labels getLabels(int i)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object