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 TypeMethodDescriptionvoid
static <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) int
getCommonElementCount
(Set<E> other) int
int
getLargestIndex
(OrderedHashSet<E> other) int
getSmallestIndex
(OrderedHashSet<E> other) int
boolean
int
remove
(int index) boolean
returns 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, toString
Methods inherited from class org.hsqldb.map.BaseHashMap
clear, clone, isEmpty, size
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:HashSet
returns 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:
getCommonElementCount
in 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
-