edu.stanford.nlp.trees
Interface Labeled

All Known Subinterfaces:
Datum, Document
All Known Implementing Classes:
BasicDatum, BasicDocument, Constituent, Tree

public interface Labeled

Interface for Objects which have a Label. For instance, they may be hand-classified with one or more tags. Note that it is for things that possess a label via composition, rather than for things that implement the Label interface. An implementor might choose to be read-only and throw an UnsupportedOperationException on the setLabel(s)() commands, but should minimally implement both commands to return Label(s).


Method Summary
 Label label()
          Returns the Object's label.
 Collection labels()
          Gives back all labels for this thing.
 void setLabel(Label label)
          Sets the label associated with this object.
 void setLabels(Collection labels)
          Sets the labels associated with this object.
 

Method Detail

label

public Label label()
Returns the Object's label.

Returns:
One of the labels of the object (if there are multiple labels, preferably the primary label, if it exists). Returns null if there is no label.

setLabel

public void setLabel(Label label)
Sets the label associated with this object.


labels

public Collection labels()
Gives back all labels for this thing.

Returns:
A Collection of the Object's labels. Returns an empty Collection if there are no labels.

setLabels

public void setLabels(Collection labels)
Sets the labels associated with this object.



Stanford NLP Group