Interface MultiSet<T>
- Type Parameters:
T
- the type of the objects in this multiset.
- All Superinterfaces:
Collection<T>
,HTMLToString
,Iterable<T>
- All Known Subinterfaces:
SortedMultiSet<T>
- All Known Implementing Classes:
AbstractMultiSet
,HashMultiSet
,LinkedHashMultiSet
,TreeMultiSet
This class implements a mutliset. The implementation is synchronized.
- Author:
- bfvdonge
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.processmining.framework.util.HTMLToString
HTMLToString.HTMLCellRenderer
-
Method Summary
Modifier and TypeMethodDescriptionAdds the given object to the multiset, as many times as indicated by the given weight parameter.baseSet()
returns an unmodifiable set of unique objects in the multiset.boolean
isLessOrEqual
(MultiSet<T> multiSet) returns true if this multiset is less or equal to the given multiset, i.e.occurrences
(Object source) returns the number of occurrences of the given object in this multiset.toList()
Converts this multiset to a list, such that each element occurs as often as returned by the iterator of the multiset (its number of occurrences).Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
Methods inherited from interface org.processmining.framework.util.HTMLToString
toHTMLString
-
Method Details
-
add
Adds the given object to the multiset, as many times as indicated by the given weight parameter.- Parameters:
par
- the object to addweight
- the number of times to add it- Returns:
- the new number of occurrences of the object (>0)
-
toList
Converts this multiset to a list, such that each element occurs as often as returned by the iterator of the multiset (its number of occurrences).- Returns:
- a list of objects as returned by the iterator
-
isLessOrEqual
returns true if this multiset is less or equal to the given multiset, i.e. all objects in this multiset should be contained in the given set and the number of occurrences in the given set is at least the number of occurrences in this multiset.- Parameters:
multiSet
- the multiset to test- Returns:
- true if the given multiset is less or equal.
-
occurrences
returns the number of occurrences of the given object in this multiset.- Parameters:
source
- the object to get the occurrences for- Returns:
- the number of occurrences, 0 if the object does not occur.
-
baseSet
returns an unmodifiable set of unique objects in the multiset.- Returns:
- an unmodifiable set of unique objects in the multiset.
-