Class OrderedHashSet<E>
java.lang.Object
org.hsqldb.lib.HashSet<E>
org.hsqldb.lib.OrderedHashSet<E>
- All Implemented Interfaces:
Collection<E>, List<E>, Set<E>
A list which is also a Set which maintains the inserted order of elements and
allows access by index. Iterators return the elements in the index order.
This class does not store null elements.
- Since:
- 1.9.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOrderedHashSet(int initialCapacity) OrderedHashSet(int initialCapacity, ObjectComparator<E> comparator) OrderedHashSet(E[] valueList) -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic <E> OrderedHashSet<E> add(OrderedHashSet<E> first, E value) add value to first.static <E> OrderedHashSet<E> addAll(OrderedHashSet<E> first, OrderedHashSet<E> second) add all elements of second to first.voidclear()Clear the map completely.org.hsqldb.map.BaseHashMapclone()get(int index) intgetCommonElementCount(Set<E> other) intintgetLargestIndex(OrderedHashSet<E> other) intgetSmallestIndex(OrderedHashSet<E> other) intbooleanbooleanisEmpty()intremove(int index) booleanreturns true if removedintsize()Object[]toArray()<T> T[]toArray(T[] array) Methods inherited from class HashSet
add, addAll, addAll, addAll, capacity, contains, containsAll, get, getOrAdd, iterator, removeAll, removeAll, toStringMethods inherited from interface Collection
addAll, clear, contains
-
Field Details
-
ACCESS_MAX
public static final int ACCESS_MAX- See Also:
-
emptyObjectArray
-
-
Constructor Details
-
OrderedHashSet
public OrderedHashSet() -
OrderedHashSet
public OrderedHashSet(int initialCapacity) -
OrderedHashSet
-
OrderedHashSet
-
-
Method Details
-
remove
-
remove
-
insert
- Throws:
IndexOutOfBoundsException
-
set
-
add
-
get
-
toArray
-
toArray
-
indexOf
-
getIndex
-
lastIndexOf
-
getLargestIndex
-
getSmallestIndex
-
getCommonElementCount
- Overrides:
getCommonElementCountin classHashSet<E>
-
addAll
add all elements of second to first. if second is null return first (which can be null), else if first is null return a new set and add the elements of second -
add
add value to first. if value is null return first (which can be null), else if first is null return a new set and add the value -
clear
public void clear()Clear the map completely. -
size
public int size() -
isEmpty
public boolean isEmpty() -
clone
public org.hsqldb.map.BaseHashMap clone()
-