E
- The type of the elements of the multisetpublic class HashMultiSet<E> extends java.lang.Object implements MultiSet<E>
Constructor and Description |
---|
HashMultiSet() |
HashMultiSet(java.util.Collection<? extends E> objects)
Creates a HashMultiSet based on the objects in the collection passed as
argument
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E arg0) |
boolean |
add(E object,
long multiplicity)
Add an object to the multiset
|
boolean |
addAll(java.util.Collection<? extends E> arg0) |
boolean |
addAll(java.util.Collection<? extends E> objects,
long multiplicity)
Add several objects to the multiset
|
void |
clear() |
boolean |
contains(java.lang.Object arg0) |
boolean |
containsAll(java.util.Collection<?> arg0) |
long |
count(java.lang.Object object) |
long |
countSubSets(java.util.Collection<?> objects)
counts the number of subsets
|
java.util.Set<E> |
entrySet()
Get the set of objects without repetitions Changes in this set will
affect the multiset
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
long |
longSize() |
boolean |
remove(java.lang.Object arg0) |
boolean |
remove(java.lang.Object arg0,
long multiplicity)
Remove several objects of the multiset
|
boolean |
removeAll(java.util.Collection<?> arg0) |
boolean |
retainAll(java.util.Collection<?> arg0) |
int |
size() |
boolean |
subtraction(java.util.Collection<?> objects)
Subtraction between multisets
|
boolean |
subtraction(java.util.Collection<?> objects,
long multiplicity)
subtracts the objects in objects a number of times equal to multiplicity
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] arg0) |
java.lang.String |
toString() |
public HashMultiSet()
public HashMultiSet(java.util.Collection<? extends E> objects)
objects
- An initial Collection for the multisetpublic boolean add(E object, long multiplicity)
MultiSet
public boolean addAll(java.util.Collection<? extends E> objects, long multiplicity)
MultiSet
public long count(java.lang.Object object)
count
in interface MultiSet<E>
MultiSet.count(java.lang.Object)
public long countSubSets(java.util.Collection<?> objects)
MultiSet
countSubSets
in interface MultiSet<E>
MultiSet.countSubSets(java.util.Collection)
public java.util.Set<E> entrySet()
MultiSet
public boolean addAll(java.util.Collection<? extends E> arg0)
addAll
in interface java.util.Collection<E>
public void clear()
clear
in interface java.util.Collection<E>
public boolean contains(java.lang.Object arg0)
contains
in interface java.util.Collection<E>
public boolean containsAll(java.util.Collection<?> arg0)
containsAll
in interface java.util.Collection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object arg0, long multiplicity)
MultiSet
public boolean remove(java.lang.Object arg0)
remove
in interface java.util.Collection<E>
public boolean removeAll(java.util.Collection<?> arg0)
removeAll
in interface java.util.Collection<E>
public boolean retainAll(java.util.Collection<?> arg0)
retainAll
in interface java.util.Collection<E>
public int size()
size
in interface java.util.Collection<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
public <T> T[] toArray(T[] arg0)
toArray
in interface java.util.Collection<E>
public boolean subtraction(java.util.Collection<?> objects)
MultiSet
subtraction
in interface MultiSet<E>
objects
- a collection containing the objects to be subtractedpublic boolean subtraction(java.util.Collection<?> objects, long multiplicity)
MultiSet
subtraction
in interface MultiSet<E>
objects
- the collection of objects to be subtractedmultiplicity
- the number of times the objects will be subtractedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<E>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<E>
hashCode
in class java.lang.Object