Package nom.tam.util
Class HashedList<VALUE extends CursorValue<String>>
java.lang.Object
nom.tam.util.HashedList<VALUE>
- Type Parameters:
VALUE- value of the map
- All Implemented Interfaces:
Iterable<VALUE>,Collection<VALUE>
public class HashedList<VALUE extends CursorValue<String>>
extends Object
implements Collection<VALUE>
a ordered hash map implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends VALUE> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleancontainsKey(Object key) get(int n) booleanisEmpty()HashedList<VALUE>.nom.tam.util.HashedList.HashedListIteratoriterator()iterator(int n) HashedList<VALUE>.nom.tam.util.HashedList.HashedListIteratorbooleanremove(int index) Remove an object from the list giving the object index..booleanbooleanremoveAll(Collection<?> c) booleanRemove a keyed object from the list.booleanreplaceKey(String oldKey, String newKey) Replace the key of a given element.booleanretainAll(Collection<?> c) intsize()voidsort(Comparator<String> comp) Sort the keys into some desired order.Object[]toArray()<T> T[]toArray(T[] o) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
HashedList
public HashedList()
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<VALUE extends CursorValue<String>>
-
addAll
- Specified by:
addAllin interfaceCollection<VALUE extends CursorValue<String>>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<VALUE extends CursorValue<String>>
-
contains
- Specified by:
containsin interfaceCollection<VALUE extends CursorValue<String>>
-
containsAll
- Specified by:
containsAllin interfaceCollection<VALUE extends CursorValue<String>>
-
containsKey
- Parameters:
key- the key to search- Returns:
trueif the key is included in the list.
-
get
- Parameters:
n- the index to get- Returns:
- the n'th entry from the beginning.
-
get
- Parameters:
key- the key to search for- Returns:
- the value of a keyed entry. Non-keyed entries may be returned by requesting an iterator.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<VALUE extends CursorValue<String>>
-
iterator
- Specified by:
iteratorin interfaceCollection<VALUE extends CursorValue<String>>- Specified by:
iteratorin interfaceIterable<VALUE extends CursorValue<String>>- Returns:
- a HashedListIterator over the entire list.
-
iterator
- Parameters:
n- the index to start the iterator- Returns:
- an iterator starting with the n'th entry.
-
iterator
- Parameters:
key- the key to use as a start point- Returns:
- an iterator over the list starting with the entry with a given key.
-
remove
public boolean remove(int index) Remove an object from the list giving the object index..- Parameters:
index- the index to remove- Returns:
- true if the index was in range
-
remove
- Specified by:
removein interfaceCollection<VALUE extends CursorValue<String>>
-
removeAll
- Specified by:
removeAllin interfaceCollection<VALUE extends CursorValue<String>>
-
removeKey
Remove a keyed object from the list. Unkeyed objects can be removed from the list using a HashedListIterator or using the remove(Object) method.- Parameters:
key- the key to remove- Returns:
trueif the key was removed
-
replaceKey
Replace the key of a given element.- Parameters:
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.- Returns:
- if the replacement was successful.
-
retainAll
- Specified by:
retainAllin interfaceCollection<VALUE extends CursorValue<String>>
-
size
public int size()- Specified by:
sizein interfaceCollection<VALUE extends CursorValue<String>>
-
sort
Sort the keys into some desired order.- Parameters:
comp- the comparator to use for the sorting
-
toArray
- Specified by:
toArrayin interfaceCollection<VALUE extends CursorValue<String>>
-
toArray
public <T> T[] toArray(T[] o) - Specified by:
toArrayin interfaceCollection<VALUE extends CursorValue<String>>
-
toString
-