org.gcn.plinguacore.util
Interface MultiSet<E>

All Superinterfaces:
java.util.Collection<E>, java.lang.Iterable<E>, java.io.Serializable
All Known Subinterfaces:
InfiniteMultiSet<E>
All Known Implementing Classes:
HashInfiniteMultiSet, HashMultiSet, InmutableMultiSet

public interface MultiSet<E>
extends java.util.Collection<E>, java.io.Serializable

Author:
Research Group on Natural Computing (http://www.gcn.us.es) An interface to define multisets

Method Summary
 boolean add(E object, long multiplicity)
          Add an object to the multiset
 boolean addAll(java.util.Collection<? extends E> objects, long multiplicity)
          Add several objects to the multiset
 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
 long longSize()
           
 boolean remove(java.lang.Object object, long multiplicity)
          Remove several objects of the multiset
 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
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

count

long count(java.lang.Object object)
Parameters:
object -
Returns:
The multiplicity of the object

countSubSets

long countSubSets(java.util.Collection<?> objects)
counts the number of subsets

Parameters:
objects -
Returns:
The number of subsets

add

boolean add(E object,
            long multiplicity)
Add an object to the multiset

Parameters:
object -
multiplicity -
Returns:
True if the multiset has been changed

addAll

boolean addAll(java.util.Collection<? extends E> objects,
               long multiplicity)
Add several objects to the multiset

Parameters:
objects -
multiplicity -
Returns:
True if the multiset has been changed

remove

boolean remove(java.lang.Object object,
               long multiplicity)
Remove several objects of the multiset

Parameters:
object -
multiplicity -
Returns:
True if the multiset has been changed

subtraction

boolean subtraction(java.util.Collection<?> objects)
Subtraction between multisets

Parameters:
objects - a collection containing the objects to be subtracted
Returns:
true if the multiset has been changed

subtraction

boolean subtraction(java.util.Collection<?> objects,
                    long multiplicity)
subtracts the objects in objects a number of times equal to multiplicity

Parameters:
objects - the collection of objects to be subtracted
multiplicity - the number of times the objects will be subtracted
Returns:
true if there was any subtraction

entrySet

java.util.Set<E> entrySet()
Get the set of objects without repetitions Changes in this set will affect the multiset

Returns:
A Set of objects

longSize

long longSize()