java.lang.Object
org.hsqldb.map.BaseHashMap
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 inherited from class org.hsqldb.map.BaseHashMap
ACCESS_MAX, emptyObjectArray -
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.get(int index) intgetCommonElementCount(Set<E> other) intintgetLargestIndex(OrderedHashSet<E> other) intgetSmallestIndex(OrderedHashSet<E> other) intbooleanintremove(int index) booleanreturns true if removedObject[]toArray()<T> T[]toArray(T[] array) Methods inherited from class org.hsqldb.lib.HashSet
add, addAll, addAll, addAll, capacity, contains, containsAll, get, getOrAdd, iterator, removeAll, removeAll, toStringMethods inherited from class org.hsqldb.map.BaseHashMap
clear, clone, isEmpty, sizeMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hsqldb.lib.Collection
addAll, clear, contains
-
Constructor Details
-
OrderedHashSet
public OrderedHashSet() -
OrderedHashSet
public OrderedHashSet(int initialCapacity) -
OrderedHashSet
-
OrderedHashSet
-
-
Method Details
-
remove
Description copied from class:HashSetreturns true if removed -
remove
-
insert
- Throws:
IndexOutOfBoundsException
-
set
-
add
-
get
-
toArray
-
toArray
public <T> T[] toArray(T[] array) -
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
-