Top Description Constructors Methods
org.hsqldb.lib

public Class OrderedHashSet<E>

extends HashSet<E>
implements List<E>, Set<E>
Class Inheritance
All Implemented Interfaces
org.hsqldb.lib.Set, org.hsqldb.lib.Collection, org.hsqldb.lib.List

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.

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.3

Constructor Summary

AccessConstructor and Description
public
public
OrderedHashSet(int initialCapacity)

public
OrderedHashSet(int initialCapacity, ObjectComparator<E> comparator)

public
OrderedHashSet(E[] valueList)

Method Summary

Modifier and TypeMethod and Description
public void
add(int index, E key)

Implements org.hsqldb.lib.List.add.

public static <E> OrderedHashSet<E>
add(OrderedHashSet<E> first, E value)

add value to first.

public static <E> OrderedHashSet<E>
addAll(OrderedHashSet<E> first, OrderedHashSet<E> second)

add all elements of second to first.

private void
checkRange(int i)

public E
get(int index)

Overrides org.hsqldb.lib.HashSet.get.

Implements org.hsqldb.lib.List.get.

public int
public int
public int
public int
public int
public boolean
insert(int index, E key)

public int
public boolean
remove(E key)

Overrides org.hsqldb.lib.HashSet.remove.

Implements org.hsqldb.lib.Collection.remove.

returns true if removed

public E
remove(int index)

Overrides org.hsqldb.lib.HashSet.remove.

Implements org.hsqldb.lib.List.remove, org.hsqldb.lib.Collection.remove.

returns true if removed

public E
set(int index, E key)

Implements org.hsqldb.lib.List.set.

public Object[]
public <T> T[]
Inherited from org.hsqldb.lib.HashSet:
addaddAlladdAlladdAllcapacitycontainscontainsAllgetOrAdditeratorremoveAllremoveAlltoString

Constructor Detail

OrderedHashSetback to summary
public OrderedHashSet()
OrderedHashSetback to summary
public OrderedHashSet(int initialCapacity)
OrderedHashSetback to summary
public OrderedHashSet(int initialCapacity, ObjectComparator<E> comparator)
OrderedHashSetback to summary
public OrderedHashSet(E[] valueList)

Method Detail

addback to summary
public void add(int index, E key)

Implements org.hsqldb.lib.List.add.

addback to summary
public static <E> OrderedHashSet<E> add(OrderedHashSet<E> first, E value)

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

addAllback to summary
public static <E> OrderedHashSet<E> addAll(OrderedHashSet<E> first, OrderedHashSet<E> second)

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

checkRangeback to summary
private void checkRange(int i)
getback to summary
public E get(int index)

Overrides org.hsqldb.lib.HashSet.get.

Implements org.hsqldb.lib.List.get.

getCommonElementCountback to summary
public int getCommonElementCount(Set<E> other)

Overrides org.hsqldb.lib.HashSet.getCommonElementCount.

getIndexback to summary
public int getIndex(Object key)
getLargestIndexback to summary
public int getLargestIndex(OrderedHashSet<E> other)
getSmallestIndexback to summary
public int getSmallestIndex(OrderedHashSet<E> other)
indexOfback to summary
public int indexOf(Object key)
insertback to summary
public boolean insert(int index, E key) throws IndexOutOfBoundsException
lastIndexOfback to summary
public int lastIndexOf(Object o)
removeback to summary
public boolean remove(E key)

Overrides org.hsqldb.lib.HashSet.remove.

Implements org.hsqldb.lib.Collection.remove.

Doc from org.hsqldb.lib.HashSet.remove.

returns true if removed

removeback to summary
public E remove(int index)

Overrides org.hsqldb.lib.HashSet.remove.

Implements org.hsqldb.lib.List.remove, org.hsqldb.lib.Collection.remove.

Doc from org.hsqldb.lib.HashSet.remove.

returns true if removed

setback to summary
public E set(int index, E key)

Implements org.hsqldb.lib.List.set.

toArrayback to summary
public Object[] toArray()

Overrides org.hsqldb.lib.HashSet.toArray.

toArrayback to summary
public <T> T[] toArray(T[] array)

Overrides org.hsqldb.lib.HashSet.toArray.