|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectmathCollection.MathCollections.SynchronizedMultiset
Field Summary | |
private Multiset |
myMultiset
|
private java.lang.Object |
myMutex
|
Constructor Summary | |
(package private) |
MathCollections.SynchronizedMultiset(Multiset mus)
|
(package private) |
MathCollections.SynchronizedMultiset(Multiset mus,
java.lang.Object mutex)
|
Method Summary | |
boolean |
add(java.lang.Object o)
|
boolean |
add(java.lang.Object o,
int quantity)
Adds the specified element quantity of times to this
multiset. |
boolean |
addAll(java.util.Collection c)
|
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
Multiset |
difference(java.util.Collection c)
Returns the asymmetric difference between this multiset and the specified collection. |
boolean |
equals(java.lang.Object o)
|
int |
getQuantity(java.lang.Object o)
Returns the number of times the specified element is present in this multiset. |
int |
hashCode()
|
Multiset |
intersection(java.util.Collection c)
Returns the intersection with the specified collection. |
boolean |
isDisjoint(java.util.Collection c)
Returns true if the specified collection has no common
elements with this multiset. |
boolean |
isEmpty()
|
boolean |
isSubset(java.util.Collection c)
Returns true if this multiset is a subset of the
specified collection. |
boolean |
isSuperset(java.util.Collection c)
Returns true if this multiset is a superset of the
specified collection. |
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object o)
|
boolean |
remove(java.lang.Object o,
int quantity)
Removes the specified element quantity of times from this
multiset if possible. |
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
boolean |
setQuantity(java.lang.Object o,
int quantity)
Adjusts the number of times the specified element is present in this multiset to be the specified value. |
int |
setSize()
Returns the size of a 'flattened' version of this multiset in which every element of this multiset is present exactly once. |
int |
size()
|
Multiset |
sum(java.util.Collection c)
Returns the sum with the specified collection. |
Multiset |
symmetricDifference(java.util.Collection c)
Returns the symmetric difference between this multiset and the specified collection. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] o)
|
java.util.Set |
toSet()
Returns a 'flattened' version of this multiset in which every element of this multiset is present exactly once. |
java.lang.String |
toString()
|
Multiset |
union(java.util.Collection c)
Returns the union with the specified collection. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private Multiset myMultiset
private java.lang.Object myMutex
Constructor Detail |
MathCollections.SynchronizedMultiset(Multiset mus)
MathCollections.SynchronizedMultiset(Multiset mus, java.lang.Object mutex)
Method Detail |
public int size()
size
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public void clear()
clear
in interface java.util.Collection
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
public int hashCode()
hashCode
in interface java.util.Collection
public java.util.Set toSet()
Multiset
toSet
in interface Multiset
public int setSize()
Multiset
setSize
in interface Multiset
public java.lang.String toString()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] o)
toArray
in interface java.util.Collection
public java.util.Iterator iterator()
iterator
in interface java.util.Collection
public java.lang.Object clone()
public boolean setQuantity(java.lang.Object o, int quantity)
Multiset
setQuantity
in interface Multiset
o
- element whose quantity gets set.quantity
- quantity of the specified element to be set.
true
if this multiset has been modified,
false
otherwise.Multiset.getQuantity(java.lang.Object)
public int getQuantity(java.lang.Object o)
Multiset
getQuantity
in interface Multiset
o
- element whose quantity is returned.
Multiset.setQuantity(java.lang.Object, int)
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
public boolean add(java.lang.Object o, int quantity)
Multiset
quantity
of times to this
multiset. If quantity
is negative or 0, false
is returned.
add
in interface Multiset
o
- element to be added to this set.quantity
- quantity of elements to add.
true
if quantity
is
greater than 0, false
otherwisepublic boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
public boolean remove(java.lang.Object o, int quantity)
Multiset
quantity
of times from this
multiset if possible. If quantity
is negative or 0,
false
is returned.
remove
in interface Multiset
o
- object to be removed from this multiset.quantity
- quantity of elements to remove.
true
if the multiset got altered,
false
otherwise.public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
public Multiset sum(java.util.Collection c)
Multiset
Multiset
containing all elements that are present in this
multiset or in the specified collection. The quantities of equal
elements get added up.
sum
in interface Multiset
c
- collection to be united with.
public Multiset union(java.util.Collection c)
Multiset
Multiset
containing all elements that are present in this
multiset or in the specified collection. For equal elements, the
resulting quantity is the maximum of the two given quantities.
union
in interface Multiset
c
- collection to be united with.
public Multiset intersection(java.util.Collection c)
Multiset
Multiset
containing all elements that are present in this
multiset as well as in the specified collection. For equal elements,
the resulting quantity is the minimum of the two given quantities.
intersection
in interface Multiset
c
- collection to be intersected with.
public Multiset difference(java.util.Collection c)
Multiset
Multiset
containing all
elements that are present in this multiset but not in the specified
collection. The quantities of equal elements get subtracted.
difference
in interface Multiset
c
- collection from which the difference is calculated.
public Multiset symmetricDifference(java.util.Collection c)
Multiset
Multiset
containing all
elements that are present either in this multiset or in the specified
collection but not in both. The quantities of equal elements get
subtracted from each other (maximum minus minimum).
symmetricDifference
in interface Multiset
c
- collection from which the symmetric difference is calculated
public boolean isDisjoint(java.util.Collection c)
Multiset
true
if the specified collection has no common
elements with this multiset.
isDisjoint
in interface Multiset
c
- collection to be checked for common elements.
true
if there are no common elements,
false
otherwise.public boolean isSubset(java.util.Collection c)
Multiset
true
if this multiset is a subset of the
specified collection. That is, if all elements of this multiset are also
present in the specified collection at least the same number of times.
isSubset
in interface Multiset
c
- collection for which is checked whether this multiset is a
subset of or not.
true
if this multiset is a subset,
false
otherwise.public boolean isSuperset(java.util.Collection c)
Multiset
true
if this multiset is a superset of the
specified collection. That is, if all elements of the specified
collection are also present in this multiset at least the same number of
times.
isSuperset
in interface Multiset
c
- collection for which is checked whether this multiset is a
superset of or not.
true
if this multiset is a superset,
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |