Top Description Fields Constructors Methods
com.jogamp.common.util

public Class ArrayHashSet<E>

extends Object
implements Cloneable, Collection<E>, List<E>
Class Inheritance
All Implemented Interfaces
java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable, java.lang.Cloneable
Imports
java.util.ArrayList, .Collection, .HashMap, .Iterator, .List, .ListIterator

Hashed ArrayList implementation of the List and Collection interface. Implementation properties are: O(1) operations: O(n) operations: For thread safety, the application shall decorate access to instances via com.jogamp.common.util.locks.RecursiveLock.

Field Summary

Modifier and TypeField and Description
private final ArrayList<E>
public static final int
DEFAULT_INITIAL_CAPACITY

The default initial capacity:

public static final float
DEFAULT_LOAD_FACTOR

Default load factor:

private final HashMap<E, E>
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
ArrayHashSet(final int initialCapacity)

public
ArrayHashSet(final int initialCapacity, final float loadFactor)

public
ArrayHashSet(final boolean
Use 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.
supportNullValue
,
final int
use DEFAULT_INITIAL_CAPACITY for default
initialCapacity
,
final float
use DEFAULT_LOAD_FACTOR for default
loadFactor
)

public

Method Summary

Modifier and TypeMethod and Description
public final boolean

Returns:

true if the element was added to this list, otherwise false (already contained).
add
(final E
element whose presence in this collection is to be ensured
element
)

Implements java.util.Collection.add, java.util.List.add.

Add element at the end of this list, if it is not contained yet.
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.util.List.add.

Add element at the given index in this list, if it is not contained yet.
public final boolean

Returns:

true if at least one element was added to this list, otherwise false (completely container).
addAll
(final Collection<? extends E>
collection containing elements to be added to this collection
c
)

Implements java.util.Collection.addAll, java.util.List.addAll.

Add all elements of given java.util.Collection 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.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

private static final void
checkNull(final Object element)

public final void
clear()

Implements java.util.Collection.clear, java.util.List.clear.

Removes all of the elements from this collection (optional operation).
public final Object

Returns:

a shallow copy of this ArrayHashSet, elements are not copied.
clone
()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public final boolean

Returns:

true if the given element is contained by this list using fast hash map, otherwise false.
contains
(final Object
element whose presence in this collection is to be tested
element
)

Implements java.util.Collection.contains, java.util.List.contains.

Test for containment This is an O(1) operation.
public final boolean

Returns:

true if the given Collection is completly contained by this list using hash map, otherwise false.
containsAll
(final Collection<?>
collection to be checked for containment in this collection
c
)

Implements java.util.Collection.containsAll, java.util.List.containsAll.

Test for containment of given java.util.Collection 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.
containsSafe
(final Object element)

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)
equals
(final Object
object to be compared for equality with this collection
arrayHashSet
)

Overrides java.lang.Object.equals.

Implements java.util.Collection.equals, java.util.List.equals.

This is an O(n) operation.
public final E
get(final int
index of the element to return
index
)

Implements java.util.List.get.

Returns the element at the specified position in this list.
public final E

Returns:

object from this list, identical to the given key hash code, or null if not contained
get
(final Object
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 ArrayList<E>
getData()

Returns this object ordered ArrayList.

public final HashMap<E, E>
getMap()

Returns this object hash map.

public final E

Returns:

object from this list, identical to the given key hash code, or add the given key and return it.
getOrAdd
(final E
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 in java.util.List#hashCode(), ie hashing all elements of this list.
hashCode
()

Overrides java.lang.Object.hashCode.

Implements java.util.Collection.hashCode, java.util.List.hashCode.

This is an O(n) operation over the size of this list.
public final int
indexOf(final Object
element to search for
element
)

Implements java.util.List.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
public final boolean
isEmpty()

Implements java.util.Collection.isEmpty, java.util.List.isEmpty.

Returns true if this collection contains no elements.
public final Iterator<E>
iterator()

Implements java.util.Collection.iterator, java.util.List.iterator.

Returns an iterator over the elements in this collection.
public final int

Returns:

index of element, or -1 if not found
lastIndexOf
(final Object
element to search for
o
)

Implements java.util.List.lastIndexOf.

Since this list is unique, equivalent to indexOf(java.lang.Object).
public final ListIterator<E>
listIterator()

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).
public final ListIterator<E>
listIterator(final int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
public final boolean

Returns:

true if the element was removed from this list, otherwise false (not contained).
remove
(final Object
element to be removed from this collection, if present
element
)

Implements java.util.Collection.remove, java.util.List.remove.

Remove element from this list.
public final E

Returns:

the removed object
remove
(final int
the index of the element to be removed
index
)

Implements java.util.List.remove.

Remove element at given index from this list.
public final boolean

Returns:

true if at least one element of this list was removed, otherwise false.
removeAll
(final Collection<?>
collection containing elements to be removed from this collection
c
)

Implements java.util.Collection.removeAll, java.util.List.removeAll.

Remove all elements of given java.util.Collection from this list.
public final boolean

Returns:

true if at least one element of this list was removed, otherwise false.
retainAll
(final Collection<?>
collection containing elements to be retained in this collection
c
)

Implements java.util.Collection.retainAll, java.util.List.retainAll.

Retain all elements of the given java.util.Collection c, ie remove all elements not contained by the given java.util.Collection 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.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

public final int
size()

Implements java.util.Collection.size, java.util.List.size.

Returns the number of elements in this collection.
public final List<E>
subList(final int
low endpoint (inclusive) of the subList
fromIndex
,
final int
high endpoint (exclusive) of the subList
toIndex
)

Implements java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
public final boolean
supportsNullValue()

Returns true for default behavior, i.e. null can be a valid value.

public final Object[]
toArray()

Implements java.util.Collection.toArray, java.util.List.toArray.

Returns an array containing all of the elements in this collection.
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.util.Collection.toArray, java.util.List.toArray.

Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
public final ArrayList<E>

Returns:

a shallow copy of this ArrayHashSet's ArrayList, elements are not copied.
toArrayList
()

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

databack to summary
private final ArrayList<E> data
DEFAULT_INITIAL_CAPACITYback to summary
public static final int DEFAULT_INITIAL_CAPACITY

The default initial capacity:

DEFAULT_LOAD_FACTORback to summary
public static final float DEFAULT_LOAD_FACTOR

Default load factor:

mapback to summary
private final HashMap<E, E> map
supportNullValueback to summary
private final boolean supportNullValue

Constructor Detail

ArrayHashSetback to summary
public ArrayHashSet()
ArrayHashSetback to summary
public ArrayHashSet(final int initialCapacity)
ArrayHashSetback to summary
public ArrayHashSet(final int initialCapacity, final float loadFactor)
ArrayHashSetback to summary
public ArrayHashSet(final boolean supportNullValue, final int initialCapacity, final float loadFactor)
Parameters
supportNullValue:boolean

Use 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.

initialCapacity:int

use DEFAULT_INITIAL_CAPACITY for default

loadFactor:float

use DEFAULT_LOAD_FACTOR for default

See Also
supportsNullValue()
ArrayHashSetback to summary
public ArrayHashSet(final ArrayHashSet<E> o)

Method Detail

addback to summary
public final boolean add(final E element) throws NullPointerException

Implements java.util.Collection.add, java.util.List.add.

Doc from java.util.Collection.add.

Add element at the end of this list, if it is not contained yet.
This is an O(1) operation

Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)

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 null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.

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 false). This preserves the invariant that a collection always contains the specified element after this call returns.

Parameters
element:E

element whose presence in this collection is to be ensured

Returns:boolean

true if the element was added to this list, otherwise false (already contained).

Annotations
@Override
Exceptions
NullPointerException:
if element is null but supportsNullValue() == false
addback to summary
public final void add(final int index, final E element) throws IllegalArgumentException, NullPointerException

Implements java.util.List.add.

Doc from java.util.List.add.

Add element at the given index in this list, if it is not contained yet.
This is an O(1) operation

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).

Parameters
index:int

index at which the specified element is to be inserted

element:E

element to be inserted

Annotations
@Override
Exceptions
IllegalArgumentException:
if the given element was already contained
NullPointerException:
if element is null but supportsNullValue() == false
addAllback to summary
public final boolean addAll(final Collection<? extends E> c)

Implements java.util.Collection.addAll, java.util.List.addAll.

Doc from java.util.Collection.addAll.

Add all elements of given java.util.Collection at the end of this list.
This is an O(n) operation, over the given Collection size.

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.

Parameters
c:Collection<? extends E>

collection containing elements to be added to this collection

Returns:boolean

true if at least one element was added to this list, otherwise false (completely container).

Annotations
@Override
addAllback to summary
public final boolean addAll(final int index, final Collection<? extends E> c) throws UnsupportedOperationException

Implements java.util.List.addAll.

Doc from java.util.List.addAll.

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.)

Parameters
index:int

index at which to insert the first element from the specified collection

c:Collection<? extends E>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the addAll operation is not supported by this list
checkNullback to summary
private static final void checkNull(final Object element) throws NullPointerException
clearback to summary
public final void clear()

Implements java.util.Collection.clear, java.util.List.clear.

Doc from java.util.Collection.clear.

Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.

Annotations
@Override
cloneback to summary
public final Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

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 x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

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 super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a shallow copy of this ArrayHashSet, elements are not copied.

Annotations
@Override
containsback to summary
public final boolean contains(final Object element)

Implements java.util.Collection.contains, java.util.List.contains.

Doc from java.util.Collection.contains.

Test for containment
This is an O(1) operation.

Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that Objects.equals(o, e).

Parameters
element:Object

element whose presence in this collection is to be tested

Returns:boolean

true if the given element is contained by this list using fast hash map, otherwise false.

Annotations
@Override
containsAllback to summary
public final boolean containsAll(final Collection<?> c)

Implements java.util.Collection.containsAll, java.util.List.containsAll.

Doc from java.util.Collection.containsAll.

Test for containment of given java.util.Collection
This is an O(n) operation, over the given Collection size.

Returns true if this collection contains all of the elements in the specified collection.

Parameters
c:Collection<?>

collection to be checked for containment in this collection

Returns:boolean

true if the given Collection is completly contained by this list using hash map, otherwise false.

Annotations
@Override
containsSafeback to summary
public final boolean containsSafe(final Object element)

Test for containment
This is an O(n) operation, using equals operation over the list.
You may utilize this method to verify your hash values,
ie contains(java.lang.Object) and containsSafe(java.lang.Object) shall have the same result.

Returns:boolean

true if the given element is contained by this list using slow equals operation, otherwise false.

equalsback to summary
public final boolean equals(final Object arrayHashSet)

Overrides java.lang.Object.equals.

Implements java.util.Collection.equals, java.util.List.equals.

Doc from java.util.Collection.equals.

This is an O(n) operation.

Compares the specified object with this collection for equality.

While the Collection interface adds no stipulations to the general contract for the Object.equals, programmers who implement the Collection interface "directly" (in other words, create a class that is a Collection but is not a Set or a List) must exercise care if they choose to override the Object.equals. It is not necessary to do so, and the simplest course of action is to rely on Object's implementation, but the implementor may wish to implement a "value comparison" in place of the default "reference comparison." (The List and Set interfaces mandate such value comparisons.)

The general contract for the Object.equals method states that equals must be symmetric (in other words, a.equals(b) if and only if b.equals(a)). The contracts for List.equals and Set.equals state that lists are only equal to other lists, and sets to other sets. Thus, a custom equals method for a collection class that implements neither the List nor Set interface must return false when this collection is compared to any list or set. (By the same logic, it is not possible to write a class that correctly implements both the Set and List interfaces.)

Parameters
arrayHashSet:Object

object to be compared for equality with this collection

Returns:boolean

true if arrayHashSet is of type ArrayHashSet and all entries are equal Performance: arrayHashSet(1)

Annotations
@Override
getback to summary
public final E get(final int index)

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:E

the element at the specified position in this list

Annotations
@Override
getback to summary
public final E get(final Object element)

Identity method allowing to get the identical object, using the internal hash map.
This is an O(1) operation.

Parameters
element:Object

hash source to find the identical Object within this list

Returns:E

object from this list, identical to the given key hash code, or null if not contained

getDataback to summary
public final ArrayList<E> getData()

Returns this object ordered ArrayList. Use w/ care, it's not a copy.

getMapback to summary
public final HashMap<E, E> getMap()

Returns this object hash map. Use w/ care, it's not a copy.

getOrAddback to summary
public final E getOrAdd(final E element) throws NullPointerException

Identity method allowing to get the identical object, using the internal hash map.
If the element is not yet contained, add it.
This is an O(1) operation.

Parameters
element:E

hash source to find the identical Object within this list

Returns:E

object from this list, identical to the given key hash code, or add the given key and return it.

Exceptions
NullPointerException:
if element is null but supportsNullValue() == false
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Collection.hashCode, java.util.List.hashCode.

Doc from java.util.Collection.hashCode.

This is an O(n) operation over the size of this list.

Returns the hash code value for this collection. While the Collection interface adds no stipulations to the general contract for the Object.hashCode method, programmers should take note that any class that overrides the Object.equals method must also override the Object.hashCode method in order to satisfy the general contract for the Object.hashCode method. In particular, c1.equals(c2) implies that c1.hashCode()==c2.hashCode().

Returns:int

the hash code of this list as define in java.util.List#hashCode(), ie hashing all elements of this list.

Annotations
@Override
indexOfback to summary
public final int indexOf(final Object element)

Implements java.util.List.indexOf.

Doc from java.util.List.indexOf.

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 i such that Objects.equals(o, get(i)), or -1 if there is no such index.

Parameters
element:Object

element to search for

Returns:int

the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element

Annotations
@Override
isEmptyback to summary
public final boolean isEmpty()

Implements java.util.Collection.isEmpty, java.util.List.isEmpty.

Doc from java.util.Collection.isEmpty.

Returns true if this collection contains no elements.

Returns:boolean

true if this collection contains no elements

Annotations
@Override
iteratorback to summary
public final Iterator<E> iterator()

Implements java.util.Collection.iterator, java.util.List.iterator.

Doc from java.util.Collection.iterator.

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).

Returns:Iterator<E>

an Iterator over the elements in this collection

Annotations
@Override
lastIndexOfback to summary
public final int lastIndexOf(final Object o)

Implements java.util.List.lastIndexOf.

Doc from java.util.List.lastIndexOf.

Since this list is unique, equivalent to indexOf(java.lang.Object).
This is an O(n) operation.

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 i such that Objects.equals(o, get(i)), or -1 if there is no such index.

Parameters
o:Object

element to search for

Returns:int

index of element, or -1 if not found

Annotations
@Override
listIteratorback to summary
public final ListIterator<E> listIterator()

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

Returns:ListIterator<E>

a list iterator over the elements in this list (in proper sequence)

Annotations
@Override
listIteratorback to summary
public final ListIterator<E> listIterator(final int index)

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

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 next. An initial call to previous would return the element with the specified index minus one.

Parameters
index:int

index of the first element to be returned from the list iterator (by a call to next)

Returns:ListIterator<E>

a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list

Annotations
@Override
removeback to summary
public final boolean remove(final Object element) throws NullPointerException

Implements java.util.Collection.remove, java.util.List.remove.

Doc from java.util.Collection.remove.

Remove element from this list.
This is an O(1) operation, in case the element does not exist, otherwise O(n).

Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).

Parameters
element:Object

element to be removed from this collection, if present

Returns:boolean

true if the element was removed from this list, otherwise false (not contained).

Annotations
@Override
Exceptions
NullPointerException:
if element is null but supportsNullValue() == false
removeback to summary
public final E remove(final int index)

Implements java.util.List.remove.

Doc from java.util.List.remove.

Remove element at given index from this list.
This is an O(n) operation.

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.

Parameters
index:int

the index of the element to be removed

Returns:E

the removed object

Annotations
@Override
removeAllback to summary
public final boolean removeAll(final Collection<?> c)

Implements java.util.Collection.removeAll, java.util.List.removeAll.

Doc from java.util.Collection.removeAll.

Remove all elements of given java.util.Collection from this list.
This is an O(n) operation.

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.

Parameters
c:Collection<?>

collection containing elements to be removed from this collection

Returns:boolean

true if at least one element of this list was removed, otherwise false.

Annotations
@Override
retainAllback to summary
public final boolean retainAll(final Collection<?> c)

Implements java.util.Collection.retainAll, java.util.List.retainAll.

Doc from java.util.Collection.retainAll.

Retain all elements of the given java.util.Collection c, ie remove all elements not contained by the given java.util.Collection c.
This is an O(n) operation.

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.

Parameters
c:Collection<?>

collection containing elements to be retained in this collection

Returns:boolean

true if at least one element of this list was removed, otherwise false.

Annotations
@Override
setback to summary
public final E set(final int index, final E element)

Implements java.util.List.set.

Doc from java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

index of the element to replace

element:E

element to be stored at the specified position

Returns:E

the element previously at the specified position

Annotations
@Override
sizeback to summary
public final int size()

Implements java.util.Collection.size, java.util.List.size.

Doc from java.util.Collection.size.

Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this collection

Annotations
@Override
subListback to summary
public final List<E> subList(final int fromIndex, final int toIndex)

Implements java.util.List.subList.

Doc from java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

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:

list.subList(from, to).clear();
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.)

Parameters
fromIndex:int

low endpoint (inclusive) of the subList

toIndex:int

high endpoint (exclusive) of the subList

Returns:List<E>

a view of the specified range within this list

Annotations
@Override
supportsNullValueback to summary
public final boolean supportsNullValue()

Returns true for default behavior, i.e. null can be a valid value.

Returns false if null is not a valid value, here remove(E) and getOrAdd(Object) are optimized operations.

See Also
ArrayHashSet(boolean, int, float)
toArrayback to summary
public final Object[] toArray()

Implements java.util.Collection.toArray, java.util.List.toArray.

Doc from java.util.Collection.toArray.

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 Object.

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.

Returns:Object[]

an array, whose runtime component type is Object, containing all of the elements in this collection

Annotations
@Override
toArrayback to summary
public final <T> T[] toArray(final T[] a)

Implements java.util.Collection.toArray, java.util.List.toArray.

Doc from java.util.Collection.toArray.

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 null. (This is useful in determining the length of this collection only if the caller knows that this collection does not contain any null elements.)

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.

Parameters
<T>
the component type of the array to contain the collection
a: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.

Returns:T[]

an array containing all of the elements in this collection

Annotations
@Override
toArrayListback to summary
public final ArrayList<E> toArrayList()
Returns:ArrayList<E>

a shallow copy of this ArrayHashSet's ArrayList, elements are not copied.

toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override