E - the type of entries in the collectionpublic class EntryCollection<E extends Entry<E>> extends AbstractCollection<E>
Entry#structuralEquals(Object). This may be different from
Entry#equals(Object), which is used for finding an element in the
collection. The main methods are inserting, removing, and finding elements
modulo structural equality.
The implementation is largely based on the implementation of
HashSet from the standard Java collection library.| Constructor and Description |
|---|
EntryCollection()
Constructs an empty
EntryCollection with the default initial
capacity (16), the default under-load factor (0.15), and the default
over-load factor (0.75). |
EntryCollection(int initialCapacity)
Constructs an empty
EntryCollection with the specified initial
capacity, the default under-load factor (0.15), and the default over-load
factor (0.75). |
EntryCollection(int initialCapacity,
float underloadFactor,
float overloadFactor)
Constructs an empty
EntryCollection with the specified initial
capacity, under-load factor, and over-load factor. |
| Modifier and Type | Method and Description |
|---|---|
void |
addStructural(E entry)
Adds the given entry to this collection; the entry is added even if a
structurally equal entry is already present in the collection
|
void |
clear()
Removes all entries from this set.
|
<T extends GenericStructuralObject<T>> |
findStructural(T key)
Finds and returns the entry in set that is structurally equal to the
input key.
|
Iterator<E> |
iterator() |
<T extends GenericStructuralObject<T>> |
removeStructural(T key)
Removes and returns the entry in the set that is structurally equal to
the specified key.
|
int |
size()
Returns the number of entries in this set.
|
add, addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic EntryCollection(int initialCapacity,
float underloadFactor,
float overloadFactor)
EntryCollection 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 factorIllegalArgumentException - if the initial capacity is negative or the load factor is
non-positivepublic EntryCollection(int initialCapacity)
EntryCollection 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 EntryCollection()
EntryCollection with the default initial
capacity (16), the default under-load factor (0.15), and the default
over-load factor (0.75).public int size()
size in interface Collection<E extends Entry<E>>size in class AbstractCollection<E extends Entry<E>>public <T extends GenericStructuralObject<T>> T findStructural(T key)
GenericStructuralObject.structuralEquals(Object) and
StructuralObject.structuralHashCode() methods.T - the type of the keykey - a GenericStructuralObject using which the required
entry should be foundnull if there is no such an entrypublic void addStructural(E entry)
entry - the entry to be inserted; it is not allowed to have linked
elements: Entry.getNext() should be nullpublic <T extends GenericStructuralObject<T>> T removeStructural(T key)
GenericStructuralObject.structuralEquals(Object) and
StructuralObject.structuralHashCode() methods.T - the type of the keykey - a GenericStructuralObject using which the required entry
should be foundnull if no entry that is equal to
the input object is foundpublic void clear()
clear in interface Collection<E extends Entry<E>>clear in class AbstractCollection<E extends Entry<E>>Copyright © 2011–2024 Live Ontologies Project. All rights reserved.