Package eu.simuline.util
Class ListMap.Entries
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<java.util.Map.Entry<K,V>>
-
- eu.simuline.util.ListMap.Entries
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<K,V>>,java.util.Collection<java.util.Map.Entry<K,V>>,java.util.Set<java.util.Map.Entry<K,V>>,java.util.SortedSet<java.util.Map.Entry<K,V>>
private class ListMap.Entries extends java.util.AbstractSet<java.util.Map.Entry<K,V>> implements java.util.SortedSet<java.util.Map.Entry<K,V>>Represents the set of entries of the enclosing map given byListMap.entrySet().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.entrySet
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEntries()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears actually the enclosingListMapdelegating toListMap.clear().java.util.Comparator<? super java.util.Map.Entry<K,V>>comparator()booleancontains(java.lang.Object obj)Returns actually whetherobjis an instance ofMap.Entrywith a key contained in the enclosingListMapdelegating toListMap.containsKey(Object).java.util.Map.Entry<K,V>first()private java.lang.ObjectgetKey(java.lang.Object obj)Assumes thatobjis aMap.Entryand returns its key.java.util.SortedSet<java.util.Map.Entry<K,V>>headSet(java.util.Map.Entry<K,V> toElement)java.util.Iterator<java.util.Map.Entry<K,V>>iterator()Returns actually an instance ofListMap.EntriesIterator.private java.util.Map.Entry<K,V>key2entry(K key)java.util.Map.Entry<K,V>last()booleanremove(java.lang.Object obj)Removesobjfrom the entry set if present and returns whether it was present.intsize()Returns actually the size of the enclosingListMapdelegating toListMap.size().java.util.SortedSet<java.util.Map.Entry<K,V>>subSet(java.util.Map.Entry<K,V> fromElement, java.util.Map.Entry<K,V> toElement)java.util.SortedSet<java.util.Map.Entry<K,V>>tailSet(java.util.Map.Entry<K,V> fromElement)-
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
-
-
-
-
Method Detail
-
iterator
public java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
Returns actually an instance ofListMap.EntriesIterator.- Specified by:
iteratorin interfacejava.util.Collection<java.util.Map.Entry<K,V>>- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<K,V>>- Specified by:
iteratorin interfacejava.util.Set<java.util.Map.Entry<K,V>>- Specified by:
iteratorin classjava.util.AbstractCollection<java.util.Map.Entry<K,V>>
-
size
public int size()
Returns actually the size of the enclosingListMapdelegating toListMap.size().
-
getKey
private java.lang.Object getKey(java.lang.Object obj)
Assumes thatobjis aMap.Entryand returns its key.- Throws:
java.lang.NullPointerException- ifobjisnull.java.lang.ClassCastException- ifobjis neithernullnor an instance ofMap.Entry.
-
contains
public boolean contains(java.lang.Object obj)
Returns actually whetherobjis an instance ofMap.Entrywith a key contained in the enclosingListMapdelegating toListMap.containsKey(Object).
-
remove
public boolean remove(java.lang.Object obj)
Removesobjfrom the entry set if present and returns whether it was present. Effectively checks whetherobjis an instance ofMap.Entry. If not returnsfalse. If it is an instance ofMap.Entryremoves the according key-value pair from the enclosingListMapif present. Returns whetherobj's key was present when invoking this method. This is done invokingListMap.Keys.remove(Object).
-
clear
public void clear()
Clears actually the enclosingListMapdelegating toListMap.clear().
-
subSet
public java.util.SortedSet<java.util.Map.Entry<K,V>> subSet(java.util.Map.Entry<K,V> fromElement, java.util.Map.Entry<K,V> toElement)
-
headSet
public java.util.SortedSet<java.util.Map.Entry<K,V>> headSet(java.util.Map.Entry<K,V> toElement)
-
-