org.gcube.common.vremanagement.deployer.impl.state
Class CountableHashSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by org.gcube.common.vremanagement.deployer.impl.state.CountableHashSet<E>
Type Parameters:
E - element type
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

public class CountableHashSet<E>
extends HashSet<E>
implements Serializable

An extension of the standard HashSet handling multiple instances of the same element.

Author:
Manuele Simi (ISTI-CNR)
See Also:
HashSet, Set, Serialized Form

Constructor Summary
CountableHashSet()
          
CountableHashSet(Collection<? extends E> c)
           
CountableHashSet(int initialCapacity)
           
CountableHashSet(int initialCapacity, float loadFactor)
           
 
Method Summary
 boolean add(E o)
          
 boolean addAll(Collection<? extends E> c)
          
 void clear()
          
 int getCounter(Object o)
          Gets the key counter of the given element
 boolean remove(Object o)
          
 boolean removeAll(Collection<?> c)
          
 
Methods inherited from class java.util.HashSet
clone, contains, isEmpty, iterator, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, retainAll, toArray, toArray
 

Constructor Detail

CountableHashSet

public CountableHashSet()


CountableHashSet

public CountableHashSet(Collection<? extends E> c)

CountableHashSet

public CountableHashSet(int initialCapacity)

CountableHashSet

public CountableHashSet(int initialCapacity,
                        float loadFactor)
Method Detail

add

public boolean add(E o)

Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Overrides:
add in class HashSet<E>

remove

public boolean remove(Object o)

Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>
Overrides:
remove in class HashSet<E>

removeAll

public boolean removeAll(Collection<?> c)

Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>
Overrides:
removeAll in class AbstractSet<E>

addAll

public boolean addAll(Collection<? extends E> c)

Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>
Overrides:
addAll in class AbstractCollection<E>

clear

public void clear()

Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
Overrides:
clear in class HashSet<E>

getCounter

public int getCounter(Object o)
Gets the key counter of the given element

Parameters:
o - the element to count
Returns:
the key counter


Copyright © 2012. All Rights Reserved.