|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.aavalla.utils.general.RetrievalHashSet<E>
public class RetrievalHashSet<E>
HashSet is an implementation of a Set. All optional operations (adding and removing) are supported. The elements can be any objects.
Constructor Summary | |
---|---|
RetrievalHashSet()
Constructs a new empty instance of HashSet . |
|
RetrievalHashSet(java.util.Collection<? extends E> collection)
Constructs a new instance of RetrievalHashSet containing the unique
elements in the specified collection. |
|
RetrievalHashSet(int capacity)
Constructs a new instance of RetrievalHashSet with the specified capacity. |
|
RetrievalHashSet(int capacity,
float loadFactor)
Constructs a new instance of RetrievalHashSet with the specified capacity
and load factor. |
Method Summary | |
---|---|
boolean |
add(E object)
Adds the specified object to this RetrievalHashSet if not already present. |
void |
clear()
Removes all elements from this RetrievalHashSet , leaving it empty. |
java.lang.Object |
clone()
Returns a new RetrievalHashSet with the same elements and size as this
RetrievalHashSet . |
boolean |
contains(java.lang.Object object)
Searches this RetrievalHashSet for the specified object. |
E |
getKey(E templateKey)
|
boolean |
isEmpty()
Returns true if this RetrievalHashSet has no elements, false otherwise. |
java.util.Iterator<E> |
iterator()
Returns an Iterator on the elements of this RetrievalHashSet . |
boolean |
remove(java.lang.Object object)
Removes the specified object from this RetrievalHashSet . |
int |
size()
Returns the number of elements in this RetrievalHashSet . |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, 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 |
---|
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public RetrievalHashSet()
HashSet
.
public RetrievalHashSet(int capacity)
RetrievalHashSet
with the specified capacity.
capacity
- the initial capacity of this RetrievalHashSet
.public RetrievalHashSet(int capacity, float loadFactor)
RetrievalHashSet
with the specified capacity
and load factor.
capacity
- the initial capacity.loadFactor
- the initial load factor.public RetrievalHashSet(java.util.Collection<? extends E> collection)
RetrievalHashSet
containing the unique
elements in the specified collection.
collection
- the collection of elements to add.Method Detail |
---|
public boolean add(E object)
RetrievalHashSet
if not already present.
add
in interface java.util.Collection<E>
add
in interface java.util.Set<E>
add
in class java.util.AbstractCollection<E>
object
- the object to add.
true
when this RetrievalHashSet
did not already contain
the object, false
otherwisepublic void clear()
RetrievalHashSet
, leaving it empty.
clear
in interface java.util.Collection<E>
clear
in interface java.util.Set<E>
clear
in class java.util.AbstractCollection<E>
isEmpty()
,
size()
public java.lang.Object clone()
RetrievalHashSet
with the same elements and size as this
RetrievalHashSet
.
clone
in class java.lang.Object
RetrievalHashSet
.Cloneable
public boolean contains(java.lang.Object object)
RetrievalHashSet
for the specified object.
contains
in interface java.util.Collection<E>
contains
in interface java.util.Set<E>
contains
in class java.util.AbstractCollection<E>
object
- the object to search for.
true
if object
is an element of this
RetrievalHashSet
, false
otherwise.public boolean isEmpty()
RetrievalHashSet
has no elements, false otherwise.
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.Set<E>
isEmpty
in class java.util.AbstractCollection<E>
true
if this RetrievalHashSet
has no elements,
false
otherwise.size()
public java.util.Iterator<E> iterator()
RetrievalHashSet
.
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.Set<E>
iterator
in class java.util.AbstractCollection<E>
RetrievalHashSet
.Iterator
public boolean remove(java.lang.Object object)
RetrievalHashSet
.
remove
in interface java.util.Collection<E>
remove
in interface java.util.Set<E>
remove
in class java.util.AbstractCollection<E>
object
- the object to remove.
true
if the object was removed, false
otherwise.public int size()
RetrievalHashSet
.
size
in interface java.util.Collection<E>
size
in interface java.util.Set<E>
size
in class java.util.AbstractCollection<E>
RetrievalHashSet
.public E getKey(E templateKey)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |