Class AbstractMultiValuedMap.KeysMultiSet
java.lang.Object
java.util.AbstractCollection<K>
org.apache.commons.collections4.multiset.AbstractMultiSet<K>
org.apache.commons.collections4.multimap.AbstractMultiValuedMap.KeysMultiSet
- All Implemented Interfaces:
Iterable<K>, Collection<K>, MultiSet<K>
- Enclosing class:
AbstractMultiValuedMap<K,V>
Inner class that provides a MultiSet keys view.
- Since:
- 4.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classNested classes/interfaces inherited from class AbstractMultiSet
AbstractMultiSet.AbstractEntry<E>, AbstractMultiSet.EntrySet<E>, AbstractMultiSet.UniqueSet<E>Nested classes/interfaces inherited from interface MultiSet
MultiSet.Entry<E> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if the multiset contains the given element.protected Iterator<MultiSet.Entry<K>> Creates an entry set iterator.intReturns the number of occurrence of the given element in this multiset by iterating over its entrySet.booleanisEmpty()intsize()Returns the number of elements in this multiset.protected intReturns the number of unique elements in this multiset.Methods inherited from class AbstractMultiSet
add, add, clear, createEntrySet, createUniqueSet, createUniqueSetIterator, doReadObject, doWriteObject, entrySet, equals, hashCode, iterator, remove, remove, removeAll, setCount, toString, uniqueSetMethods inherited from class AbstractCollection
addAll, containsAll, retainAll, toArray, toArrayMethods inherited from interface Collection
addAll, parallelStream, removeIf, spliterator, stream, toArray, toArrayMethods inherited from interface MultiSet
containsAll, retainAll
-
Constructor Details
-
KeysMultiSet
private KeysMultiSet()
-
-
Method Details
-
contains
Description copied from class:AbstractMultiSetDetermines if the multiset contains the given element.- Specified by:
containsin interfaceCollection<K>- Overrides:
containsin classAbstractMultiSet<K>- Parameters:
o- the object to search for- Returns:
- true if the multiset contains the given element
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>- Overrides:
isEmptyin classAbstractCollection<K>
-
size
public int size()Description copied from class:AbstractMultiSetReturns the number of elements in this multiset.- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceMultiSet<K>- Overrides:
sizein classAbstractMultiSet<K>- Returns:
- current size of the multiset
-
uniqueElements
protected int uniqueElements()Description copied from class:AbstractMultiSetReturns the number of unique elements in this multiset.- Specified by:
uniqueElementsin classAbstractMultiSet<K>- Returns:
- the number of unique elements
-
getCount
Description copied from class:AbstractMultiSetReturns the number of occurrence of the given element in this multiset by iterating over its entrySet. -
createEntrySetIterator
Description copied from class:AbstractMultiSetCreates an entry set iterator. Subclasses can override this to return iterators with different properties.- Specified by:
createEntrySetIteratorin classAbstractMultiSet<K>- Returns:
- the entrySet iterator
-