gshute.util
Interface Dictionary

All Known Implementing Classes:
ListDictionary

public abstract interface Dictionary

A Dictionary is a random access collection in which search keys are an integral part of a data entry.


Method Summary
 void add(java.lang.Object dat)
          dict.add(dat) adds dat to dict.
 void clear()
          dict.clear() removes all entries from dict.
 java.lang.Object dataFor(java.lang.Object k)
          dict.dataFor(k) returns the data for key k in dict.
 java.lang.Object getKey(java.lang.Object dat)
          dict.getKey(dat) returns the key that dict uses for dat.
 boolean isKey(java.lang.Object k)
          dict.isKey(k) returns true if there is an entry with key k in dict.
 java.util.Iterator iterator()
          dict.iterator() returns an iterator for all of the entries in dict.
 java.util.Iterator iterator(java.lang.Object kLo)
          dict.iterator(Object kLo) returns an iterator for the entries in dict whose key is at least kLo.
 java.util.Iterator iterator(java.lang.Object kLo, java.lang.Object kHi)
          dict.iterator(Object kLo, Object kHi) returns an iterator for the entries in dict whose key is at least kLo and less than kHi.
 void remove(java.lang.Object k)
          dict.remove(k) removes the entry for key k from dict.
 int size()
          dict.size() returns the number of entries in dict.
 

Method Detail

isKey

public boolean isKey(java.lang.Object k)
dict.isKey(k) returns true if there is an entry with key k in dict.

getKey

public java.lang.Object getKey(java.lang.Object dat)
dict.getKey(dat) returns the key that dict uses for dat.

add

public void add(java.lang.Object dat)
dict.add(dat) adds dat to dict.

Precondition: dict.isKey(dict.getKey(dat)) is false.


dataFor

public java.lang.Object dataFor(java.lang.Object k)
dict.dataFor(k) returns the data for key k in dict.

Precondition: dict.isKey(k) is true.


remove

public void remove(java.lang.Object k)
dict.remove(k) removes the entry for key k from dict.

Precondition: dict.isKey(k) is true.


size

public int size()
dict.size() returns the number of entries in dict.

clear

public void clear()
dict.clear() removes all entries from dict.

iterator

public java.util.Iterator iterator()
dict.iterator() returns an iterator for all of the entries in dict.

iterator

public java.util.Iterator iterator(java.lang.Object kLo)
dict.iterator(Object kLo) returns an iterator for the entries in dict whose key is at least kLo.

iterator

public java.util.Iterator iterator(java.lang.Object kLo,
                                   java.lang.Object kHi)
dict.iterator(Object kLo, Object kHi) returns an iterator for the entries in dict whose key is at least kLo and less than kHi.