|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
org.semanticweb.elk.util.collections.entryset.EntryHashSet<E>
E - the type of entries in the collectionpublic class EntryHashSet<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>
A duplicate-free collection of entries E#equals(Object). The main
method is merging a entry into the collection, which returns an equal entry
from the collection, if there is one, or, otherwise, inserts the input entry
into the collection returning itself. Other methods include finding an entry
in the collection that is equal to the given one, deleting such an entry from
the collection, if found, and iterating over the entries.
The implementation is largely based on the implementation of
HashSet from the standard Java collection library.
| Constructor Summary | |
|---|---|
EntryHashSet()
Constructs an empty EntryHashSet with the default initial
capacity (16), the default under-load factor (0.15), and the default
over-load factor (0.75). |
|
EntryHashSet(int initialCapacity)
Constructs an empty EntryHashSet with the specified initial
capacity, the default under-load factor (0.15), and the default over-load
factor (0.75). |
|
EntryHashSet(int initialCapacity,
float underloadFactor,
float overloadFactor)
Constructs an empty EntryHashSet with the specified initial
capacity, under-load factor, and over-load factor. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all entries from this set. |
Iterator<E> |
iterator()
|
int |
size()
Returns the number of entries in this set. |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public EntryHashSet(int initialCapacity,
float underloadFactor,
float overloadFactor)
EntryHashSet with the specified initial
capacity, under-load factor, and over-load factor. The over-load factor
needs to be larger than twice the under-load factor (ideally even more).
initialCapacity - the initial capacityunderloadFactor - the under-load factoroverloadFactor - the over-load factor
IllegalArgumentException - if the initial capacity is negative or the load factor is
non-positivepublic EntryHashSet(int initialCapacity)
EntryHashSet with the specified initial
capacity, the default under-load factor (0.15), and the default over-load
factor (0.75).
initialCapacity - the initial capacity.
IllegalArgumentException - if the initial capacity is negative.public EntryHashSet()
EntryHashSet with the default initial
capacity (16), the default under-load factor (0.15), and the default
over-load factor (0.75).
| Method Detail |
|---|
public int size()
size in interface Collection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>size in class AbstractCollection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>public void clear()
clear in interface Collection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>clear in class AbstractCollection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>public Iterator<E> iterator()
iterator in interface Iterable<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>iterator in interface Collection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>iterator in class AbstractCollection<E extends org.semanticweb.elk.util.collections.entryset.Entry<E>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||