    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Interface DataStructures.HashTable

public interface HashTable

Protocol for hash tables. Note that all "matching" is based on the equals method.

##

find(Hashable)
  Find an item in the hash table.
insert(Hashable)
  Insert into the hash table.
makeEmpty()
  Make the hash table logically empty.
remove(Hashable)
  Remove from the hash table.

##

insert

    public abstract void insert(Hashable x)

  Insert into the hash table. If the item is already present, then replace it with the new item.

  Parameters:
    x - the item to insert.

remove

    public abstract void remove(Hashable x) throws ItemNotFound

  Remove from the hash table.

  Parameters:
    x - the item to remove.
  Throws: ItemNotFound
    if no item that matches x can be found in the hash table.

find

    public abstract Hashable find(Hashable x) throws ItemNotFound

  Find an item in the hash table.

  Parameters:
    x - the item to search for.
  Returns:
    the matching item.
  Throws: ItemNotFound
    if no item that matches x can be found in the hash table.

makeEmpty

    public abstract void makeEmpty()

  Make the hash table logically empty.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index