Package eu.simuline.util
Class ListMap.Keys
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<K>
-
- eu.simuline.util.ListMap.Keys
-
- All Implemented Interfaces:
Iterable<K>,Collection<K>,Set<K>,SortedSet<K>
private class ListMap.Keys extends AbstractSet<K> implements SortedSet<K>
Represents the key set of the enclosing map given byListMap.keySet().Like base class
AbstractSet, this class supports neitherSet.add(Object)norSet.addAll(Collection), i.e. those methods throw anUnsupportedOperationException. In contrast, this class supports methodsSet.clear(),Set.remove(Object),Set.removeAll(Collection)andSet.retainAll(Collection). The iterator returned byiterator()supportsIterator.remove().- See Also:
ListMap.keysSet
-
-
Constructor Summary
Constructors Modifier Constructor Description privateKeys()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears actually the enclosingListMapdelegating toListMap.clear().Comparator<? super K>comparator()booleancontains(Object obj)Returns actually whetherobjis a key of the enclosingListMapdelegating toListMap.containsKey(Object).Kfirst()SortedSet<K>headSet(K toElement)Iterator<K>iterator()Returns actually an instance ofListMap.KeysIterator.Klast()booleanremove(Object obj)Interpretesobjas key of the enclosingListMapand removes the according key-value pair if present.intsize()Returns actually the size of the enclosingListMapdelegating toListMap.size().SortedSet<K>subSet(K fromElement, K toElement)SortedSet<K>tailSet(K fromElement)-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
add, addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
spliterator
-
-
-
-
Method Detail
-
iterator
public Iterator<K> iterator()
Returns actually an instance ofListMap.KeysIterator.
-
size
public int size()
Returns actually the size of the enclosingListMapdelegating toListMap.size().- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceSet<K>- Specified by:
sizein classAbstractCollection<K>
-
contains
public boolean contains(Object obj)
Returns actually whetherobjis a key of the enclosingListMapdelegating toListMap.containsKey(Object).- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Overrides:
containsin classAbstractCollection<K>
-
remove
public boolean remove(Object obj)
Interpretesobjas key of the enclosingListMapand removes the according key-value pair if present. Returns whether the according key-value pair was present when invoking this method usingListMap.removeIdx(int).- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollection<K>
-
clear
public void clear()
Clears actually the enclosingListMapdelegating toListMap.clear().- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceSet<K>- Overrides:
clearin classAbstractCollection<K>
-
comparator
public Comparator<? super K> comparator()
- Specified by:
comparatorin interfaceSortedSet<K>
-
-