edu.stanford.nlp.trees
Class NullLabel

java.lang.Object
  |
  +--edu.stanford.nlp.trees.AbstractLabel
        |
        +--edu.stanford.nlp.trees.NullLabel
All Implemented Interfaces:
Comparable, HasCategory, HasTag, HasWord, Label

public class NullLabel
extends AbstractLabel
implements HasWord, HasTag, HasCategory

A NullLabel object acts as a Label with linguistic attributes, but doesn't actually store or return anything. It returns null to any requests. Designed to be extended.


Constructor Summary
NullLabel()
           
 
Method Summary
 String category()
          Return the category value of the label (or null if none).
static LabelFactory factory()
          Return a factory for this kind of label.
 LabelFactory labelFactory()
          Return a factory for this kind of label.
 void setCategory(String category)
          Set the category value for the label (if one is stored).
 void setTag(String tag)
          Set the tag value for the label (if one is stored).
 void setWord(String word)
          Set the word value for the label (if one is stored).
 String tag()
          Return the tag value of the label (or null if none).
 String word()
          Return the word value of the label (or null if none).
 
Methods inherited from class edu.stanford.nlp.trees.AbstractLabel
compareTo, equals, hashCode, setFromString, setValue, toString, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullLabel

public NullLabel()
Method Detail

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

tag

public String tag()
Description copied from interface: HasTag
Return the tag value of the label (or null if none).

Specified by:
tag in interface HasTag
Returns:
String the tag value for the label

setTag

public void setTag(String tag)
Description copied from interface: HasTag
Set the tag value for the label (if one is stored).

Specified by:
setTag in interface HasTag
Parameters:
tag - The tag value for the label

category

public String category()
Description copied from interface: HasCategory
Return the category value of the label (or null if none).

Specified by:
category in interface HasCategory
Returns:
String the category value for the label

setCategory

public void setCategory(String category)
Description copied from interface: HasCategory
Set the category value for the label (if one is stored).

Specified by:
setCategory in interface HasCategory

labelFactory

public LabelFactory labelFactory()
Return a factory for this kind of label. (I.e., NullLabel.) The factory returned is always the same one (a singleton).

Specified by:
labelFactory in interface Label
Specified by:
labelFactory in class AbstractLabel
Returns:
The label factory

factory

public static LabelFactory factory()
Return a factory for this kind of label.

Returns:
The label factory


Stanford NLP Group