grammar.cfg
Class MySentence

java.lang.Object
  extended by grammar.cfg.MySentence

public class MySentence
extends java.lang.Object

TSentences

Author:
XZW

Constructor Summary
MySentence()
          Creates an instance of sentence.
 
Method Summary
 void addLength(int plus)
          Adds a plus length to the parse length
 void addSymbol(java.lang.String symbol)
          Adds a symbol to sentence, and increases the number of symbols
 boolean equals(java.lang.Object obj)
           
 int getLength()
          Returns the parse length
 java.lang.String getSentence()
          Returns the string form of sentence
 int getSymbolNumber()
          Returns the number of symbols at the sentence
 int hashCode()
           
 void setLength(int length)
          Sets the parse length
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MySentence

public MySentence()
Creates an instance of sentence. The created instance has no symbols.

Method Detail

addSymbol

public void addSymbol(java.lang.String symbol)
Adds a symbol to sentence, and increases the number of symbols

Parameters:
symbol - the symbol to add.

getSentence

public java.lang.String getSentence()
Returns the string form of sentence

Returns:
the string form of sentence

getSymbolNumber

public int getSymbolNumber()
Returns the number of symbols at the sentence

Returns:
the number of symbols at the sentence

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLength

public int getLength()
Returns the parse length

Returns:
the parse length

setLength

public void setLength(int length)
Sets the parse length

Parameters:
length - the length to set

addLength

public void addLength(int plus)
Adds a plus length to the parse length

Parameters:
plus - the length to add.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object