Opus5
Class ChainedScatterTable
java.lang.Object
|
+--Opus5.AbstractObject
|
+--Opus5.AbstractContainer
|
+--Opus5.AbstractSearchableContainer
|
+--Opus5.AbstractHashTable
|
+--Opus5.ChainedScatterTable
- All Implemented Interfaces:
- Comparable, Container, HashTable, SearchableContainer
- public class ChainedScatterTable
- extends AbstractHashTable
A chained hash table implemented using an array.
- Version:
- $Id: ChainedScatterTable.java,v 3.2 1998/07/28 02:24:04 brpreiss Exp $
- Author:
- Bruno R. Preiss, P.Eng.
- See Also:
HashTable
|
Constructor Summary |
ChainedScatterTable(int length)
Constructs a ChainedScatterTable with the specified length. |
|
Method Summary |
void |
accept(Visitor visitor)
Accepts the specified visitor and makes it visit all the objects
in this chained scatter table. |
protected int |
compareTo(Comparable arg)
Compares this chained scatter table with the specified comparable object. |
Comparable |
find(Comparable object)
Finds an object in this chained scatter table
that matches the specified object. |
Enumeration |
getEnumeration()
Returns an enumeration that enumerates the objects
in this chained scatter table. |
int |
getLength()
Returns the lenght of this chained scatter table. |
void |
insert(Comparable object)
Inserts the specified comparable object into this chained scatter table. |
boolean |
isFull()
Tests if this chained scatter table is full. |
boolean |
isMember(Comparable object)
Tests whether the specified object is contained
in this chained scatter table. |
void |
purge()
Purges this chained scatter table, making it empty. |
void |
withdraw(Comparable object)
Withdraws the specified object from this chained scatter table. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
array
protected ChainedScatterTable.Entry[] array
- An array of entries.
ChainedScatterTable
public ChainedScatterTable(int length)
- Constructs a
ChainedScatterTable with the specified length.
- Parameters:
length - The desired length.
getLength
public int getLength()
- Returns the lenght of this chained scatter table.
- Overrides:
getLength in class AbstractHashTable
- Returns:
- the lenght of this chained scatter table.
purge
public void purge()
- Purges this chained scatter table, making it empty.
isFull
public boolean isFull()
- Tests if this chained scatter table is full.
- Overrides:
isFull in class AbstractContainer
- Returns:
- True if this chained scatter table is full; false otherwise.
accept
public void accept(Visitor visitor)
- Accepts the specified visitor and makes it visit all the objects
in this chained scatter table.
- Overrides:
accept in class AbstractContainer
- Parameters:
visitor - The visitor to accept.
insert
public void insert(Comparable object)
- Inserts the specified comparable object into this chained scatter table.
- Parameters:
object - The object to insert.- Throws:
ContainerFullException - If this chained scatter table is full.
find
public Comparable find(Comparable object)
- Finds an object in this chained scatter table
that matches the specified object.
- Parameters:
object - The object to match.- Returns:
- The object in this chained scatter table
that matches the specified object;
null if no match.
withdraw
public void withdraw(Comparable object)
- Withdraws the specified object from this chained scatter table.
- Parameters:
object - The object to be withdrawn.- Throws:
ContainerEmptyException - If this chained scatter table is empty.java.lang.IllegalArgumentException - If the specified object is not in this chained scatter table.
isMember
public boolean isMember(Comparable object)
- Tests whether the specified object is contained
in this chained scatter table.
- Parameters:
object - The object for which to look.- Returns:
- True if the specified object is in this chained scatter table;
false otherwise.
getEnumeration
public Enumeration getEnumeration()
- Returns an enumeration that enumerates the objects
in this chained scatter table.
- Returns:
- An enumeration that enumerates the objects
in this chained scatter table.
compareTo
protected int compareTo(Comparable arg)
- Compares this chained scatter table with the specified comparable object.
This method is not implemented.
- Overrides:
compareTo in class AbstractObject
- Parameters:
arg - The object with which this chained scatter table is compared.- Throws:
MethodNotImplemented - Always.