Package org.apache.lucene.search
Class Multiset<T>
java.lang.Object
java.util.AbstractCollection<T>
org.apache.lucene.search.Multiset<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
A
Multiset
is a set that allows for duplicate elements. Two Multiset
s are equal
if they contain the same unique elements and if each unique element has as many occurrences in
both multisets. Iteration order is not specified.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, 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, spliterator, stream, toArray
-
Constructor Details
-
Multiset
public Multiset()Create an emptyMultiset
.
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceCollection<T>
- Specified by:
iterator
in interfaceIterable<T>
- Specified by:
iterator
in classAbstractCollection<T>
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
- Overrides:
clear
in classAbstractCollection<T>
-
add
- Specified by:
add
in interfaceCollection<T>
- Overrides:
add
in classAbstractCollection<T>
-
remove
- Specified by:
remove
in interfaceCollection<T>
- Overrides:
remove
in classAbstractCollection<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
- Overrides:
contains
in classAbstractCollection<T>
-
equals
- Specified by:
equals
in interfaceCollection<T>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<T>
- Overrides:
hashCode
in classObject
-