gr.demokritos.iit.jinsect.structs
Class WordDefinition

java.lang.Object
  extended by gr.demokritos.iit.jinsect.structs.WordDefinition
All Implemented Interfaces:
java.io.Serializable

public class WordDefinition
extends java.lang.Object
implements java.io.Serializable

A serializable word definition.

See Also:
Serialized Form

Field Summary
 int Hash
          A hash corresponding to the word described by the definition.
 java.lang.String Word
          The word described by the definition.
 
Constructor Summary
WordDefinition(java.lang.String sWord)
          Creates a new instance of WordDefinition, given a word.
 
Method Summary
 boolean equals(java.lang.Object oObj)
          Compares two word definitions.
 int hashCode()
          Returns the hashcode of this word.
static int hashWord(java.lang.String sWord)
          Calculates a hash for the word: (size * 8192) + ascii code sum.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Word

public java.lang.String Word
The word described by the definition.


Hash

public int Hash
A hash corresponding to the word described by the definition.

Constructor Detail

WordDefinition

public WordDefinition(java.lang.String sWord)
Creates a new instance of WordDefinition, given a word.

Parameters:
sWord - The word.
Method Detail

hashWord

public static int hashWord(java.lang.String sWord)
Calculates a hash for the word: (size * 8192) + ascii code sum.

Parameters:
sWord - The word to hash.

hashCode

public final int hashCode()
Returns the hashcode of this word.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

equals

public final boolean equals(java.lang.Object oObj)
Compares two word definitions.

Overrides:
equals in class java.lang.Object
Parameters:
oObj - The word definition to compare this definition with.
Returns:
True if this object and the given object refer to the same word.