| java.lang.Object org.eclipse.jface.viewers.CustomHashtable
CustomHashtable | final class CustomHashtable (Code) | | CustomHashtable associates keys with values. Keys and values cannot be null.
The size of the Hashtable is the number of key/value pairs it contains.
The capacity is the number of key/value pairs the Hashtable can hold.
The load factor is a float value which determines how full the Hashtable
gets before expanding the capacity. If the load factor of the Hashtable
is exceeded, the capacity is doubled.
CustomHashtable allows a custom comparator and hash code provider.
|
Constructor Summary | |
public | CustomHashtable() Constructs a new Hashtable using the default capacity
and load factor. | public | CustomHashtable(int capacity) Constructs a new Hashtable using the specified capacity
and the default load factor. | public | CustomHashtable(IElementComparer comparer) Constructs a new hash table with the default capacity and the given
element comparer. | public | CustomHashtable(int capacity, IElementComparer comparer) Constructs a new hash table with the given capacity and the given
element comparer. | public | CustomHashtable(CustomHashtable table, IElementComparer comparer) Constructs a new hash table with enough capacity to hold all keys in the
given hash table, then adds all key/value pairs in the given hash table
to the new one, using the given element comparer. |
Method Summary | |
public boolean | containsKey(Object key) Answers if this Hashtable contains the specified object as a key
of one of the key/value pairs. | public Enumeration | elements() Answers an Enumeration on the values of this Hashtable. | public Object | get(Object key) Answers the value associated with the specified key in
this Hashtable. | public IElementComparer | getComparer() Returns the element comparer used to compare keys and to obtain
hash codes for keys, or null if no comparer has been
provided. | public Enumeration | keys() Answers an Enumeration on the keys of this Hashtable. | public Object | put(Object key, Object value) Associate the specified value with the specified key in this Hashtable.
If the key already exists, the old value is replaced. | public Object | remove(Object key) Remove the key/value pair with the specified key from this Hashtable. | public int | size() Answers the number of key/value pairs in this Hashtable. | public String | toString() Answers the string representation of this Hashtable. |
DEFAULT_CAPACITY | final public static int DEFAULT_CAPACITY(Code) | | The default capacity used when not specified in the constructor.
|
elementCount | transient int elementCount(Code) | | |
elementData | transient HashMapEntry[] elementData(Code) | | |
firstSlot | transient int firstSlot(Code) | | |
lastSlot | transient int lastSlot(Code) | | |
CustomHashtable | public CustomHashtable()(Code) | | Constructs a new Hashtable using the default capacity
and load factor.
|
CustomHashtable | public CustomHashtable(int capacity)(Code) | | Constructs a new Hashtable using the specified capacity
and the default load factor.
Parameters: capacity - the initial capacity |
CustomHashtable | public CustomHashtable(IElementComparer comparer)(Code) | | Constructs a new hash table with the default capacity and the given
element comparer.
Parameters: comparer - the element comparer to use to compare keys and obtainhash codes for keys, or null to use the normal equals and hashCode methods |
CustomHashtable | public CustomHashtable(int capacity, IElementComparer comparer)(Code) | | Constructs a new hash table with the given capacity and the given
element comparer.
Parameters: capacity - the maximum number of elements that can be added withoutrehashing Parameters: comparer - the element comparer to use to compare keys and obtainhash codes for keys, or null to use the normal equals and hashCode methods |
CustomHashtable | public CustomHashtable(CustomHashtable table, IElementComparer comparer)(Code) | | Constructs a new hash table with enough capacity to hold all keys in the
given hash table, then adds all key/value pairs in the given hash table
to the new one, using the given element comparer.
Parameters: table - the original hash table to copy from Parameters: comparer - the element comparer to use to compare keys and obtainhash codes for keys, or null to use the normal equals and hashCode methods |
containsKey | public boolean containsKey(Object key)(Code) | | Answers if this Hashtable contains the specified object as a key
of one of the key/value pairs.
Parameters: key - the object to look for as a key in this Hashtable true if object is a key in this Hashtable, false otherwise |
elements | public Enumeration elements()(Code) | | Answers an Enumeration on the values of this Hashtable. The
results of the Enumeration may be affected if the contents
of this Hashtable are modified.
an Enumeration of the values of this Hashtable |
get | public Object get(Object key)(Code) | | Answers the value associated with the specified key in
this Hashtable.
Parameters: key - the key of the value returned the value associated with the specified key, null if the specified keydoes not exist |
getComparer | public IElementComparer getComparer()(Code) | | Returns the element comparer used to compare keys and to obtain
hash codes for keys, or null if no comparer has been
provided.
the element comparer or null since: 3.2 |
keys | public Enumeration keys()(Code) | | Answers an Enumeration on the keys of this Hashtable. The
results of the Enumeration may be affected if the contents
of this Hashtable are modified.
an Enumeration of the keys of this Hashtable |
put | public Object put(Object key, Object value)(Code) | | Associate the specified value with the specified key in this Hashtable.
If the key already exists, the old value is replaced. The key and value
cannot be null.
Parameters: key - the key to add Parameters: value - the value to add the old value associated with the specified key, null if the key didnot exist |
remove | public Object remove(Object key)(Code) | | Remove the key/value pair with the specified key from this Hashtable.
Parameters: key - the key to remove the value associated with the specified key, null if the specified keydid not exist |
size | public int size()(Code) | | Answers the number of key/value pairs in this Hashtable.
the number of key/value pairs in this Hashtable |
toString | public String toString()(Code) | | Answers the string representation of this Hashtable.
the string representation of this Hashtable |
|
|