public class HashedList extends Object implements Collection
Modifier and Type | Class and Description |
---|---|
class |
HashedList.HashedListIterator
This inner class defines an iterator over the hashed list.
|
Constructor and Description |
---|
HashedList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object reference)
Add an element to the end of the list.
|
boolean |
add(Object key,
Object reference)
Add a keyed element to the end of the list.
|
boolean |
addAll(Collection c)
Add another collection to this one list.
|
void |
clear()
Clear the collection
|
boolean |
contains(Object o)
Does the HashedList contain this element?
|
boolean |
containsAll(Collection c)
Does the HashedList contain all the elements
of this other collection.
|
boolean |
containsKey(Object key)
Check if the key is included in the list
|
Object |
get(int n)
Return the n'th entry from the beginning.
|
Object |
get(Object key)
Return the value of a keyed entry.
|
boolean |
isEmpty()
Is the HashedList empty?
|
Iterator |
iterator()
Return an iterator over the entire list.
|
HashedList.HashedListIterator |
iterator(int n)
Return an iterator starting with the n'th
entry.
|
HashedList.HashedListIterator |
iterator(Object key)
Return an iterator over the list starting
with the entry with a given key.
|
boolean |
remove(Object o)
Remove an object from the list.
|
boolean |
removeAll(Collection c)
Remove all the elements that are found in another collection.
|
boolean |
removeKey(Object key)
Remove a keyed object from the list.
|
boolean |
replaceKey(Object oldKey,
Object newKey)
Replace the key of a given element.
|
boolean |
retainAll(Collection c)
Retain only elements contained in another collection
|
int |
size()
Return the number of elements in the list.
|
Object[] |
toArray()
Convert to an array of objects
|
Object[] |
toArray(Object[] o)
Convert to an array of objects of
a specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public boolean add(Object reference)
add
in interface Collection
public boolean removeKey(Object key)
public boolean remove(Object o)
remove
in interface Collection
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
public HashedList.HashedListIterator iterator(Object key) throws NoSuchElementException
NoSuchElementException
public HashedList.HashedListIterator iterator(int n) throws NoSuchElementException
NoSuchElementException
public Object get(Object key)
public Object get(int n) throws NoSuchElementException
NoSuchElementException
public boolean replaceKey(Object oldKey, 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(Object key)
public int size()
size
in interface Collection
public boolean addAll(Collection c)
addAll
in interface Collection
public void clear()
clear
in interface Collection
public boolean contains(Object o)
contains
in interface Collection
public boolean containsAll(Collection c)
containsAll
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public boolean removeAll(Collection c)
removeAll
in interface Collection
public boolean retainAll(Collection c)
retainAll
in interface Collection
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] o)
toArray
in interface Collection
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.