org.jwall.util
Class MultiSet<E>

java.lang.Object
  extended by org.jwall.util.MultiSet<E>
All Implemented Interfaces:
Serializable

public class MultiSet<E>
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
MultiSet()
           
 
Method Summary
 void add(E key)
          Erhöht den Count für key im 1.
 void addCount(E key, Long c)
           
 void clear()
           
 int distinctSize()
          Returns the number of distinct values contained in this multiset.
 Long getCount(E key)
          Liefert den Count für key zurück.
 double getPercentage(E key)
          Deprecated.  
 Long getTotal()
           
 Set<E> getValues()
           
 boolean hasValue(E v)
           
 Iterator<E> iterator()
          This returns an iterator that can be used to iterate over the set of distinct values contained in this multi-set.
 E remove(E o)
           
 E removeAll(E o)
           
 int size()
          Returns the number of values contained in this set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

MultiSet

public MultiSet()
Method Detail

add

public void add(E key)
Erhöht den Count für key im 1.

Parameters:
key -

getCount

public Long getCount(E key)
Liefert den Count für key zurück.

Parameters:
key -
Returns:

remove

public E remove(E o)

removeAll

public E removeAll(E o)

getPercentage

public double getPercentage(E key)
Deprecated. 

Parameters:
key -
Returns:

getValues

public Set<E> getValues()

getTotal

public Long getTotal()

toString

public String toString()
Overrides:
toString in class Object

hasValue

public boolean hasValue(E v)

iterator

public Iterator<E> iterator()
This returns an iterator that can be used to iterate over the set of distinct values contained in this multi-set. Thus, the iteration does not contain two values which are equal.

Returns:
An iterator of all distinct values.

size

public int size()
Returns the number of values contained in this set. This is the number of distinct values times the count of each distinct value.

Returns:
The total number of values.

distinctSize

public int distinctSize()
Returns the number of distinct values contained in this multiset.

Returns:
Number of distinct values.

clear

public void clear()

addCount

public void addCount(E key,
                     Long c)


Copyright © 2014. All Rights Reserved.