public class HashedList
extends java.lang.Object
implements java.util.Collection
Constructor and Description |
---|
HashedList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int pos,
java.lang.Object key,
java.lang.Object reference)
Add an element to the list.
|
boolean |
add(java.lang.Object reference)
Add an element to the end of the list.
|
boolean |
add(java.lang.Object key,
java.lang.Object reference)
Add a keyed element to the end of the list.
|
boolean |
addAll(java.util.Collection c)
Add another collection to this one list.
|
void |
clear()
Clear the collection
|
boolean |
contains(java.lang.Object o)
Does the HashedList contain this element?
|
boolean |
containsAll(java.util.Collection c)
Does the HashedList contain all the elements
of this other collection.
|
boolean |
containsKey(java.lang.Object key)
Check if the key is included in the list
|
java.lang.Object |
get(int n)
Return the n'th entry from the beginning.
|
java.lang.Object |
get(java.lang.Object key)
Return the value of a keyed entry.
|
boolean |
isEmpty()
Is the HashedList empty?
|
java.util.Iterator |
iterator()
Return an iterator over the entire list.
|
nom.tam.util.HashedList.HashedListIterator |
iterator(int n)
Return an iterator starting with the n'th
entry.
|
nom.tam.util.HashedList.HashedListIterator |
iterator(java.lang.Object key)
Return an iterator over the list starting
with the entry with a given key.
|
boolean |
remove(int index)
Remove an object from the list giving the object index..
|
boolean |
remove(java.lang.Object o)
Remove an object from the list giving just
the object value.
|
boolean |
removeAll(java.util.Collection c)
Remove all the elements that are found in another collection.
|
boolean |
removeKey(java.lang.Object key)
Remove a keyed object from the list.
|
boolean |
replaceKey(java.lang.Object oldKey,
java.lang.Object newKey)
Replace the key of a given element.
|
boolean |
retainAll(java.util.Collection c)
Retain only elements contained in another collection
|
int |
size()
Return the number of elements in the list.
|
void |
sort(java.util.Comparator comp)
Sort the keys into some desired order.
|
java.lang.Object[] |
toArray()
Convert to an array of objects
|
java.lang.Object[] |
toArray(java.lang.Object[] o)
Convert to an array of objects of
a specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean add(java.lang.Object reference)
add
in interface java.util.Collection
public boolean add(java.lang.Object key, java.lang.Object reference)
public boolean add(int pos, java.lang.Object key, java.lang.Object reference)
pos
- The element before which the current element
be placed. If pos is null put the element at
the end of the list.key
- The hash key for the new object. This may be null
for an unkeyed entry.reference
- The actual object being stored.public boolean removeKey(java.lang.Object key)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
public boolean remove(int index)
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
public nom.tam.util.HashedList.HashedListIterator iterator(java.lang.Object key) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public nom.tam.util.HashedList.HashedListIterator iterator(int n) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public java.lang.Object get(java.lang.Object key)
public java.lang.Object get(int n) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public boolean replaceKey(java.lang.Object oldKey, java.lang.Object newKey)
oldKey
- The previous key. This key must
be present in the hash.newKey
- The new key. This key
must not be present in the hash.public boolean containsKey(java.lang.Object key)
public int size()
size
in interface java.util.Collection
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
public void clear()
clear
in interface java.util.Collection
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] o)
toArray
in interface java.util.Collection
public void sort(java.util.Comparator comp)