edu.umass.cs.mallet.base.types
Class LabelsSequence

java.lang.Object
  extended byedu.umass.cs.mallet.base.types.LabelsSequence
All Implemented Interfaces:
Sequence, java.io.Serializable

public class LabelsSequence
extends java.lang.Object
implements Sequence, 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.

See Also:
Serialized Form

Constructor Summary
LabelsSequence(Labels[] seq)
          Create a LabelsSequence from an array.
 
Method Summary
 java.lang.Object get(int i)
           
 Labels getLabels(int i)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelsSequence

public LabelsSequence(Labels[] seq)
Create a LabelsSequence from an array. The array is shallow-copied.

Method Detail

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()