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>
public final class Multiset<T> extends AbstractCollection<T>
AMultiset
is a set that allows for duplicate elements. TwoMultiset
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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T e)
void
clear()
boolean
contains(Object o)
boolean
equals(Object obj)
int
hashCode()
Iterator<T>
iterator()
boolean
remove(Object o)
int
size()
-
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 Detail
-
Multiset
public Multiset()
Create an emptyMultiset
.
-
-
Method Detail
-
iterator
public Iterator<T> 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
public boolean add(T e)
- Specified by:
add
in interfaceCollection<T>
- Overrides:
add
in classAbstractCollection<T>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<T>
- Overrides:
remove
in classAbstractCollection<T>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<T>
- Overrides:
contains
in classAbstractCollection<T>
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceCollection<T>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<T>
- Overrides:
hashCode
in classObject
-
-