de.ls5.jlearn.shared
Class WordImpl

java.lang.Object
  extended by de.ls5.jlearn.shared.WordImpl
All Implemented Interfaces:
Word, Serializable, Comparable<Word>

public class WordImpl
extends Object
implements Word

Author:
merten
See Also:
Serialized Form

Constructor Summary
WordImpl()
           
WordImpl(int length)
          Deprecated. 
WordImpl(Symbol[] s)
           
 
Method Summary
 void addSymbol(Symbol symbol)
          add Symbol to word
 int compareTo(Word w)
           
 boolean equals(Object o)
           
 Symbol[] getSymbolArray()
          Assemble an array of symbols in this word
 Symbol getSymbolByIndex(int i)
          Return symbol that is at the supplied position
 List<Symbol> getSymbolList()
          Assemble a list of symbols in this word
 int hashCode()
           
 boolean isPrefixOf(Word w)
          Checks if this word is a prefix of the supplied word.
 int size()
          Determine number of symbols in this word
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WordImpl

public WordImpl()

WordImpl

@Deprecated
public WordImpl(int length)
Deprecated. 


WordImpl

public WordImpl(Symbol[] s)
Method Detail

addSymbol

public void addSymbol(Symbol symbol)
Description copied from interface: Word
add Symbol to word

Specified by:
addSymbol in interface Word

getSymbolArray

public Symbol[] getSymbolArray()
Description copied from interface: Word
Assemble an array of symbols in this word

Specified by:
getSymbolArray in interface Word
Returns:
array of symbols

getSymbolList

public List<Symbol> getSymbolList()
Description copied from interface: Word
Assemble a list of symbols in this word

Specified by:
getSymbolList in interface Word
Returns:
list of symbols

isPrefixOf

public boolean isPrefixOf(Word w)
Description copied from interface: Word
Checks if this word is a prefix of the supplied word.

Specified by:
isPrefixOf in interface Word
Returns:
true if this word is prefix, false otherwise

compareTo

public int compareTo(Word w)
Specified by:
compareTo in interface Comparable<Word>

size

public int size()
Description copied from interface: Word
Determine number of symbols in this word

Specified by:
size in interface Word
Returns:
number of symbols in word

getSymbolByIndex

public Symbol getSymbolByIndex(int i)
Description copied from interface: Word
Return symbol that is at the supplied position

Specified by:
getSymbolByIndex in interface Word
Returns:
symbol at position i, null if no such symbol exists

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011. All Rights Reserved.