public class HashNode
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
private int |
hash |
An integer that holds the hash number of the HashNode
|
private HashNode |
next |
Holds the reference to the next HashNode in the linked list
|
private java.lang.String |
ticTacToe |
The value of the HashNode; this class was specifically created
for use with TicTacToe Strings, which is why it was named as such.
|
| Constructor | Description |
|---|---|
HashNode() |
Creates an object of type HashNode and initializes all
of its field as the defaults
|
HashNode(int h,
java.lang.String t) |
Creates a HashNode object using the pertinent values:
a hash code and a String value, but does not set the next
HashNode in the linked list
|
HashNode(int h,
java.lang.String t,
HashNode n) |
Creates a HashNode object using a hash code and a String value and setting
the next HashNode in the linked-list
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
getHash() |
Returns the hash code of the HashNode.
|
HashNode |
getNext() |
Returns the HashNode after the current one in the array.
|
java.lang.String |
getValue() |
Returns the value of the String field, which is the main value
of the Object itself.
|
boolean |
hasNext() |
Returns whether there is another HashNode after this one.
|
void |
setNext(HashNode h) |
Sets the values of the next HashNode in the array using a given
HashNode.
|
private int hash
private java.lang.String ticTacToe
private HashNode next
public HashNode()
public HashNode(int h,
java.lang.String t)
h - the hash code that the value is being stored att - the value of the Hashpublic HashNode(int h,
java.lang.String t,
HashNode n)
h - the hash code the value is being stored att - the value of the HashNoden - the next HashNode in the listpublic java.lang.String getValue()
public int getHash()
public boolean hasNext()
public HashNode getNext()
public void setNext(HashNode h)
h - the HashNode to be set as next