Package 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 simpleSequenceimplementation where all of the elements must be Labels. Provides a convenient type-safe accessorgetLabels(int). Instances of LabelsSequence are immutable.- Author:
- Andrew McCallum mccallum@cs.umass.edu
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LabelsSequence(Labels[] seq)Create a LabelsSequence from an array.LabelsSequence(LabelSequence seq)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(int i)AlphabetgetAlphabet()Alphabet[]getAlphabets()LabelsgetLabels(int i)intsize()java.lang.StringtoString()
-
-
-
Constructor Detail
-
LabelsSequence
public LabelsSequence(Labels[] seq)
Create a LabelsSequence from an array. The array is shallow-copied.
-
LabelsSequence
public LabelsSequence(LabelSequence seq)
-
-
Method Detail
-
getAlphabet
public Alphabet getAlphabet()
- Specified by:
getAlphabetin interfaceAlphabetCarrying
-
getAlphabets
public Alphabet[] getAlphabets()
- Specified by:
getAlphabetsin interfaceAlphabetCarrying
-
getLabels
public Labels getLabels(int i)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-