edu.neu.ccs.demeter
Class Word

java.lang.Object
  |
  +--edu.neu.ccs.demeter.Word
All Implemented Interfaces:
Serializable

public final class Word
extends Object
implements Serializable

A terminal class for parsing a word. Put Word in a class dictionary to represent a word (any sequence of non-whitespace characters) in an input sentence.

See Also:
Serialized Form

Constructor Summary
Word()
          Construct an empty word.
Word(Object obj)
          Construct a Word from an Object by converting it to a String with Object.toString().
Word(String s)
          Construct a Word from a String.
 
Method Summary
 boolean equals(Object word)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Word

public Word()
Construct an empty word.


Word

public Word(String s)
Construct a Word from a String. Note that a Word created outside of the parser is not constrained to be a single word.


Word

public Word(Object obj)
Construct a Word from an Object by converting it to a String with Object.toString(). Note that a Word created outside of the parser is not constrained to be a single word.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object word)
Overrides:
equals in class Object