org.jjoost.collections.sets.wrappers
Class SynchronizedMultiSet<V>

java.lang.Object
  extended by org.jjoost.collections.base.SynchronizedDelegator
      extended by org.jjoost.collections.sets.wrappers.SynchronizedArbitrarySet<V,MultiSet<V>>
          extended by org.jjoost.collections.sets.wrappers.SynchronizedMultiSet<V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<V>, AnyReadSet<V>, AnySet<V>, MultiSet<V>, Function<V,java.lang.Boolean>

public class SynchronizedMultiSet<V>
extends SynchronizedArbitrarySet<V,MultiSet<V>>
implements MultiSet<V>

See Also:
Serialized Form

Constructor Summary
SynchronizedMultiSet(MultiSet<V> delegate)
           
 
Method Summary
 MultiSet<V> copy()
          Returns a copy of the set.
 void put(V val, int numberOfTimes)
          Insert the value into the set the specified number of times.
 Set<V> unique()
          Returns an AnySet (usually a Set) representing only the unique values present in this set; if this set is already unique this method should return the set itself.
 
Methods inherited from class org.jjoost.collections.sets.wrappers.SynchronizedArbitrarySet
add, all, apply, clear, clearAndReturn, contains, count, equality, first, isEmpty, iterator, list, permitsDuplicates, put, putAll, putIfAbsent, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, removeAndReturnFirst, shrink, totalCount, uniqueCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jjoost.collections.MultiSet
put
 
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
 

Constructor Detail

SynchronizedMultiSet

public SynchronizedMultiSet(MultiSet<V> delegate)
Method Detail

copy

public MultiSet<V> copy()
Description copied from interface: AnySet
Returns a copy of the set. This method may or may not return a set of the same class as the one it was called on, however must be of the same basic interface (either Set or MultiSet).

Specified by:
copy in interface AnySet<V>
Specified by:
copy in interface MultiSet<V>
Overrides:
copy in class SynchronizedArbitrarySet<V,MultiSet<V>>

put

public void put(V val,
                int numberOfTimes)
Description copied from interface: MultiSet
Insert the value into the set the specified number of times.

Specified by:
put in interface MultiSet<V>
Parameters:
val - the val
numberOfTimes - the number of times

unique

public Set<V> unique()
Description copied from interface: AnySet
Returns an AnySet (usually a Set) representing only the unique values present in this set; if this set is already unique this method should return the set itself. Changes to each set should be reflected in the other, however put() operations on the unique() set will not be supported if the underlying set is not itself unique.

Specified by:
unique in interface AnyReadSet<V>
Specified by:
unique in interface AnySet<V>
Specified by:
unique in interface MultiSet<V>
Overrides:
unique in class SynchronizedArbitrarySet<V,MultiSet<V>>
Returns:
unique values