|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.common.util.ArrayHashSet
public class ArrayHashSet
Hashed ArrayList implementation of the List and Collection interface. Implementation properties are:
Object.hashCode() for O(1) operations, see below.List functionality,
ie List.indexOf(java.lang.Object)
and List.get(int), hence object identity can be implemented.get(java.lang.Object)RecursiveLock.
| Constructor Summary | |
|---|---|
ArrayHashSet()
|
|
| Method Summary | |
|---|---|
void |
add(int index,
Object element)
Add element at the given index in this list, if it is not contained yet. |
boolean |
add(Object element)
Add element at the end of this list, if it is not contained yet. |
boolean |
addAll(Collection c)
Add all elements of given Collection at the end of this list. |
boolean |
addAll(int index,
Collection c)
|
void |
clear()
|
Object |
clone()
|
boolean |
contains(Object element)
Test for containment This is an O(1) operation. |
boolean |
containsAll(Collection c)
Test for containment of given Collection
This is an O(n) operation, over the given Collection size. |
boolean |
containsSafe(Object element)
Test for containment This is an O(n) operation, using equals operation over the list. |
boolean |
equals(Object arrayHashSet)
This is an O(n) operation. |
Object |
get(int index)
|
Object |
get(Object key)
Identity method allowing to get the identical object, using the internal hash map. |
Object |
getOrAdd(Object key)
Identity method allowing to get the identical object, using the internal hash map. If the key is not yet contained, add it. |
int |
hashCode()
This is an O(n) operation over the size of this list. |
int |
indexOf(Object element)
|
boolean |
isEmpty()
|
Iterator |
iterator()
|
int |
lastIndexOf(Object o)
Since this list is unique, equivalent to indexOf(java.lang.Object). |
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
Object |
remove(int index)
Remove element at given index from this list. |
boolean |
remove(Object element)
Remove element from this list. |
boolean |
removeAll(Collection c)
Remove all elements of given Collection from this list. |
boolean |
retainAll(Collection c)
Retain all elements of the given Collection c, ie
remove all elements not contained by the given Collection c. |
Object |
set(int index,
Object element)
|
int |
size()
|
List |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
ArrayList |
toArrayList()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayHashSet()
| Method Detail |
|---|
public final Object clone()
clone in class Objectpublic final void clear()
clear in interface Collectionclear in interface Listpublic final boolean add(Object element)
add in interface Collectionadd in interface Listpublic final boolean remove(Object element)
remove in interface Collectionremove in interface Listpublic final boolean addAll(Collection c)
Collection at the end of this list.
addAll in interface CollectionaddAll in interface Listpublic final boolean contains(Object element)
contains in interface Collectioncontains in interface Listpublic final boolean containsAll(Collection c)
Collection
containsAll in interface CollectioncontainsAll in interface Listpublic final boolean removeAll(Collection c)
Collection from this list.
removeAll in interface CollectionremoveAll in interface Listpublic final boolean retainAll(Collection c)
Collection c, ie
remove all elements not contained by the given Collection c.
retainAll in interface CollectionretainAll in interface Listpublic final boolean equals(Object arrayHashSet)
equals in interface Collectionequals in interface Listequals in class Objectpublic final int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in class ObjectList.hashCode(),
ie hashing all elements of this list.public final boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic final Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listpublic final int size()
size in interface Collectionsize in interface Listpublic final Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic final Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic final Object get(int index)
get in interface Listpublic final int indexOf(Object element)
indexOf in interface List
public final void add(int index,
Object element)
add in interface ListIllegalArgumentException - if the given element was already contained
public final boolean addAll(int index,
Collection c)
addAll in interface ListUnsupportedOperationException
public final Object set(int index,
Object element)
set in interface ListUnsupportedOperationExceptionpublic final Object remove(int index)
remove in interface Listpublic final int lastIndexOf(Object o)
indexOf(java.lang.Object).
lastIndexOf in interface Listpublic final ListIterator listIterator()
listIterator in interface Listpublic final ListIterator listIterator(int index)
listIterator in interface List
public final List subList(int fromIndex,
int toIndex)
subList in interface Listpublic final ArrayList toArrayList()
public final Object get(Object key)
key - hash source to find the identical Object within this list
key hash code,
or null if not containedpublic final Object getOrAdd(Object key)
key is not yet contained, add it.
key - hash source to find the identical Object within this list
key hash code,
or add the given key and return it.public final boolean containsSafe(Object element)
contains(java.lang.Object) and containsSafe(java.lang.Object)
shall have the same result.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||