java.lang.Object#hashCode() for O(1) operations, see below.java.util.List functionality,
ie java.util.List#indexOf(java.lang.Object)
and java.util.List#get(int) , hence object identity can be implemented.get(java.lang.Object) com.jogamp.common.util.locks.RecursiveLock .
| Modifier and Type | Field and Description |
|---|---|
| private final ArrayList | |
| public static final int | DEFAULT_INITIAL_CAPACITY
The default initial capacity: |
| public static final float | DEFAULT_LOAD_FACTOR
Default load factor: |
| private final HashMap | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ArrayHashSet(final int initialCapacity, final float loadFactor)
Deprecated
Use
ArrayHashSet(boolean, int, float)
|
| public | ArrayHashSet(final boolean
Use supportNullValue, final int true for default behavior, i.e. null can be a valid value.
Use false if null is not a valid value,
here remove(E) and getOrAdd(Object) will be optimized.use initialCapacity, final float DEFAULT_INITIAL_CAPACITY for defaultuse loadFactor)DEFAULT_LOAD_FACTOR for default
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | Returns: true if the element was added to this list, otherwise false (already contained).element whose presence in this collection is to be ensured element)Implements java. |
| public final void | add(final int
index at which the specified element is to be inserted index, final E element to be inserted element)Implements java. |
| public final boolean | Returns: true if at least one element was added to this list, otherwise false (completely container).collection containing elements to be added to this collection c)Implements java. java. at the end of this list.
|
| public final boolean | addAll(final int
index at which to insert the first element from the
specified collection index, final Collection<? extends E> collection containing elements to be added to this list c)Implements java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). |
| private static final void | |
| public final void | clear()
Implements java. |
| public final Object | Returns: a shallow copy of this ArrayHashSet, elements are not copied.Overrides java. |
| public final boolean | Returns: true if the given element is contained by this list using fast hash map, otherwise false.element whose presence in this collection is to be tested element)Implements java. |
| public final boolean | Returns: true if the given Collection is completly contained by this list using hash map, otherwise false.collection to be checked for containment in this collection c)Implements java. java.
This is an O(n) operation, over the given Collection size.
|
| public final boolean | Returns: true if the given element is contained by this list using slow equals operation, otherwise false.Test for containment This is an O(n) operation, using equals operation over the list. |
| public final boolean | Returns: true if arrayHashSet is of type ArrayHashSet and all entries are equal Performance: arrayHashSet(1)object to be compared for equality with this collection arrayHashSet)Overrides java. Implements java. |
| public final E | get(final int
index of the element to return index)Implements java. |
| public final E | |
| public final ArrayList | |
| public final HashMap | |
| public final E | Returns: object from this list, identical to the givenkey hash code,
or add the given key and return it.hash source to find the identical Object within this list element)Identity method allowing to get the identical object, using the internal hash map. |
| public final int | Returns: the hash code of this list as define injava.,
ie hashing all elements of this list.Overrides java. Implements java. |
| public final int | indexOf(final Object
element to search for element)Implements java. |
| public final boolean | isEmpty()
Implements java. true if this collection contains no elements.
|
| public final Iterator | iterator()
Implements java. |
| public final int | Returns: index of element, or -1 if not foundelement to search for o)Implements java. indexOf(java..
|
| public final ListIterator | listIterator()
Implements java. |
| public final ListIterator | listIterator(final int
index of the first element to be returned from the
list iterator (by a call to index)next)Implements java. |
| public final boolean | Returns: true if the element was removed from this list, otherwise false (not contained).element to be removed from this collection, if present element)Implements java. |
| public final E | Returns: the removed objectthe index of the element to be removed index)Implements java. |
| public final boolean | Returns: true if at least one element of this list was removed, otherwise false.collection containing elements to be removed from this collection c)Implements java. java. from this list.
|
| public final boolean | Returns: true if at least one element of this list was removed, otherwise false.collection containing elements to be retained in this collection c)Implements java. java. c, ie
remove all elements not contained by the given java. c.
|
| public final E | set(final int
index of the element to replace index, final E element to be stored at the specified position element)Implements java. Replaces the element at the specified position in this list with the specified element (optional operation). |
| public final int | size()
Implements java. |
| public final List | subList(final int
low endpoint (inclusive) of the subList fromIndex, final int high endpoint (exclusive) of the subList toIndex)Implements java. fromIndex, inclusive, and toIndex, exclusive.
|
| public final boolean | |
| public final Object[] | toArray()
Implements java. |
| public final <T> T[] | toArray(final T[]
the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. a)Implements java. |
| public final ArrayList | |
| public final String |
| data | back to summary |
|---|---|
| private final ArrayList<E> data | |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int DEFAULT_INITIAL_CAPACITY The default initial capacity: | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| public static final float DEFAULT_LOAD_FACTOR Default load factor: | |
| map | back to summary |
|---|---|
| private final HashMap<E, E> map | |
| supportNullValue | back to summary |
|---|---|
| private final boolean supportNullValue | |
| ArrayHashSet | back to summary |
|---|---|
| public ArrayHashSet()
Deprecated | |
| ArrayHashSet | back to summary |
|---|---|
| public ArrayHashSet(final int initialCapacity)
Deprecated | |
| ArrayHashSet | back to summary |
|---|---|
| public ArrayHashSet(final int initialCapacity, final float loadFactor)
Deprecated | |
| ArrayHashSet | back to summary |
|---|---|
public ArrayHashSet(final boolean supportNullValue, final int initialCapacity, final float loadFactor)
| |
| ArrayHashSet | back to summary |
|---|---|
| public ArrayHashSet(final ArrayHashSet<E> o) | |
| add | back to summary |
|---|---|
| public final boolean add(final E element) throws NullPointerException Implements java. Doc from java. Add element at the end of this list, if it is not contained yet.
Ensures that this collection contains the specified element (optional
operation). Returns
Collections that support this operation may place limitations on what
elements may be added to this collection. In particular, some
collections will refuse to add
If a collection refuses to add a particular element for any reason
other than that it already contains the element, it must throw
an exception (rather than returning
| |
| add | back to summary |
|---|---|
| public final void add(final int index, final E element) throws IllegalArgumentException, NullPointerException Implements java. Doc from java. Add element at the given index in this list, if it is not contained yet.
Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
| |
| addAll | back to summary |
|---|---|
| public final boolean addAll(final Collection<? extends E> c) Implements java. Doc from java. Add all elements of given Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| addAll | back to summary |
|---|---|
| public final boolean addAll(final int index, final Collection<? extends E> c) throws UnsupportedOperationException Implements java. Doc from java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| checkNull | back to summary |
|---|---|
| private static final void checkNull(final Object element) throws NullPointerException | |
| clear | back to summary |
|---|---|
| public final void clear() Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.
| |
| clone | back to summary |
|---|---|
| public final Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| contains | back to summary |
|---|---|
| public final boolean contains(final Object element) Implements java. Doc from java. Test for containment
Returns | |
| containsAll | back to summary |
|---|---|
| public final boolean containsAll(final Collection<?> c) Implements java. Doc from java. Test for containment of given
Returns
| |
| containsSafe | back to summary |
|---|---|
| public final boolean containsSafe(final Object element) Test for containment
| |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object arrayHashSet) Overrides java. Implements java. Doc from java. This is an O(n) operation. Compares the specified object with this collection for equality.
While the
The general contract for the | |
| get | back to summary |
|---|---|
| public final E get(final int index) Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| get | back to summary |
|---|---|
| public final E get(final Object element) Identity method allowing to get the identical object, using the internal hash map.
| |
| getData | back to summary |
|---|---|
| public final ArrayList Returns this object ordered ArrayList. Use w/ care, it's not a copy. | |
| getMap | back to summary |
|---|---|
| public final HashMap Returns this object hash map. Use w/ care, it's not a copy. | |
| getOrAdd | back to summary |
|---|---|
| public final E getOrAdd(final E element) throws NullPointerException Identity method allowing to get the identical object, using the internal hash map.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Implements java. Doc from java. This is an O(n) operation over the size of this list.
Returns the hash code value for this collection. While the
| |
| indexOf | back to summary |
|---|---|
| public final int indexOf(final Object element) Implements java. Doc from java. Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the lowest index | |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() Implements java. Doc from java. Returns
| |
| iterator | back to summary |
|---|---|
| public final Iterator Implements java. Doc from java. Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee). | |
| lastIndexOf | back to summary |
|---|---|
| public final int lastIndexOf(final Object o) Implements java. Doc from java. Since this list is unique, equivalent to
Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the highest index | |
| listIterator | back to summary |
|---|---|
| public final ListIterator Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper sequence).
| |
| listIterator | back to summary |
|---|---|
| public final ListIterator Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
The specified index indicates the first element that would be
returned by an initial call to
| |
| remove | back to summary |
|---|---|
| public final boolean remove(final Object element) throws NullPointerException Implements java. Doc from java. Remove element from this list.
Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element
| |
| remove | back to summary |
|---|---|
| public final E remove(final int index) Implements java. Doc from java. Remove element at given index from this list.
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
| |
| removeAll | back to summary |
|---|---|
| public final boolean removeAll(final Collection<?> c) Implements java. Doc from java. Remove all elements of given Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| retainAll | back to summary |
|---|---|
| public final boolean retainAll(final Collection<?> c) Implements java. Doc from java. Retain all elements of the given Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| set | back to summary |
|---|---|
| public final E set(final int index, final E element) Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation).
| |
| size | back to summary |
|---|---|
| public final int size() Implements java. Doc from java. Returns the number of elements in this collection. If this collection
contains more than
| |
| subList | back to summary |
|---|---|
| public final List Implements java. Doc from java. Returns a view of the portion of this list between the specified
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
Similar idioms may be constructed for indexOf and
lastIndexOf, and all of the algorithms in the
Collections class can be applied to a subList.The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.) | |
| supportsNullValue | back to summary |
|---|---|
| public final boolean supportsNullValue() Returns
Returns
| |
| toArray | back to summary |
|---|---|
| public final Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this collection.
If this collection makes any guarantees as to what order its elements
are returned by its iterator, this method must return the elements in
the same order. The returned array's runtime component type is The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
| |
| toArray | back to summary |
|---|---|
| public final <T> T[] toArray(final T[] a) Implements java. Doc from java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection. If this collection fits in the specified array with room to spare
(i.e., the array has more elements than this collection), the element
in the array immediately following the end of the collection is set to
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
| |
| toArrayList | back to summary |
|---|---|
public final ArrayList
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |