|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MultiSet<V>
This interface declares a set that supports multiple occurrences of each value
Note that the iterator() method will return an Iterator that
enumerates every occurence of every value. If you want
to get unique occurences of values, call the unique() method.
Also note that an Iterator returned by concurrent implementors of this class is permitted
to return values more times than they actually ever occurred if a valid sequence of deletes and inserts happens
to cause the Iterator to see the values multiple times. See the javadoc of the implementing classes
to determine their behaviour in this case.
| Method Summary | |
|---|---|
MultiSet<V> |
copy()
Returns a copy of the set. |
V |
put(V val)
Insert the value into the set. |
void |
put(V val,
int numberOfTimes)
Insert the value into the set the specified number of times. |
Set<V> |
unique()
Returns a Set representing only the unique values present in this set. |
| Methods inherited from interface org.jjoost.collections.AnySet |
|---|
add, clear, clearAndReturn, putAll, putIfAbsent, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, removeAndReturnFirst, shrink |
| Methods inherited from interface org.jjoost.collections.AnyReadSet |
|---|
all, contains, count, equality, first, isEmpty, list, permitsDuplicates, totalCount, uniqueCount |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.jjoost.util.Function |
|---|
apply |
| Method Detail |
|---|
V put(V val)
put in interface AnySet<V>val - the val
void put(V val,
int numberOfTimes)
val - the valnumberOfTimes - the number of timesMultiSet<V> copy()
MultiSet
copy in interface AnySet<V>Set<V> unique()
Set representing only the unique values present in this set.
Changes to each set should be reflected in the other, however put() operations on the unique()
set are not supported.
unique in interface AnyReadSet<V>unique in interface AnySet<V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||