Top Description Fields Constructors Methods
org.hsqldb.lib

public Class HsqlDeque<E>

extends BaseList<E>
implements List<E>
Class Inheritance
All Implemented Interfaces
org.hsqldb.lib.List, org.hsqldb.lib.Collection
Imports
java.lang.reflect.Array, java.util.Arrays, .NoSuchElementException

A List<E> that also implements Deque<E> and Queue<E> and methods for usage as stack.

When used as Queue<E>, elements are added to the end of the List (tail), and retrieved from the start of the List (head).

When used as a stack, elements are added to and retrieved from the start of the List (head) using push() and pop() methods.

Data is stored in an Object[] that doubles in size when the List gets full but does not shrink when it gets empty.

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

Field Summary

Modifier and TypeField and Description
private static final int
private int
private int
private Object[]
Inherited from org.hsqldb.lib.BaseList:
comparatorelementCount

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(int i, E o)

Implements org.hsqldb.lib.List.add.

public boolean
add(E o)

Implements abstract org.hsqldb.lib.BaseList.add.

Implements org.hsqldb.lib.List.add.

public void
addFirst(E o)

public void
addLast(E o)

public void
public boolean
public Iterator<E>
public E
public E
get(int i)

Implements abstract org.hsqldb.lib.BaseList.get.

Implements org.hsqldb.lib.List.get.

public E
private int
public E
public int
public int
lastIndexOf(E value)

public boolean
offer(E e)

public boolean
public boolean
offerLast(E e)

public E
peek()

public E
public E
public E
poll()

public E
public E
public E
pop()

public void
push(E e)

public E
public boolean
public E
remove(int index)

Implements abstract org.hsqldb.lib.BaseList.remove.

Implements org.hsqldb.lib.List.remove.

public E
public boolean
public E
public boolean
private void
public E
set(int i, E o)

Implements org.hsqldb.lib.List.set.

public int
public <T> T[]
toArray(T[] array)

public Object[]
Inherited from org.hsqldb.lib.BaseList:
addAlladdAllisEmptyiteratortoString

Field Detail

DEFAULT_INITIAL_CAPACITYback to summary
private static final int DEFAULT_INITIAL_CAPACITY
endindexback to summary
private int endindex
firstindexback to summary
private int firstindex
listback to summary
private Object[] list

Constructor Detail

HsqlDequeback to summary
public HsqlDeque()

Method Detail

addback to summary
public void add(int i, E o) throws IndexOutOfBoundsException

Implements org.hsqldb.lib.List.add.

addback to summary
public boolean add(E o)

Implements abstract org.hsqldb.lib.BaseList.add.

Implements org.hsqldb.lib.List.add.

addFirstback to summary
public void addFirst(E o)
addLastback to summary
public void addLast(E o)
clearback to summary
public void clear()

Implements org.hsqldb.lib.Collection.clear.

containsback to summary
public boolean contains(Object value)

Overrides org.hsqldb.lib.BaseList.contains.

Implements org.hsqldb.lib.Collection.contains.

descendingIteratorback to summary
public Iterator<E> descendingIterator()
elementback to summary
public E element()
getback to summary
public E get(int i) throws IndexOutOfBoundsException

Implements abstract org.hsqldb.lib.BaseList.get.

Implements org.hsqldb.lib.List.get.

getFirstback to summary
public E getFirst() throws NoSuchElementException
getInternalIndexback to summary
private int getInternalIndex(int i) throws IndexOutOfBoundsException
getLastback to summary
public E getLast() throws NoSuchElementException
indexOfback to summary
public int indexOf(E value)

Overrides org.hsqldb.lib.BaseList.indexOf.

lastIndexOfback to summary
public int lastIndexOf(E value)
offerback to summary
public boolean offer(E e)
offerFirstback to summary
public boolean offerFirst(E e)
offerLastback to summary
public boolean offerLast(E e)
peekback to summary
public E peek()
peekFirstback to summary
public E peekFirst()
peekLastback to summary
public E peekLast()
pollback to summary
public E poll()
pollFirstback to summary
public E pollFirst()
pollLastback to summary
public E pollLast()
popback to summary
public E pop()
pushback to summary
public void push(E e)
removeback to summary
public E remove()
removeback to summary
public boolean remove(E value)

Implements org.hsqldb.lib.Collection.remove.

removeback to summary
public E remove(int index)

Implements abstract org.hsqldb.lib.BaseList.remove.

Implements org.hsqldb.lib.List.remove.

removeFirstback to summary
public E removeFirst() throws NoSuchElementException
removeFirstOccurrenceback to summary
public boolean removeFirstOccurrence(E o)
removeLastback to summary
public E removeLast() throws NoSuchElementException
removeLastOccurrenceback to summary
public boolean removeLastOccurrence(E o)
resetCapacityback to summary
private void resetCapacity()
setback to summary
public E set(int i, E o) throws IndexOutOfBoundsException

Implements org.hsqldb.lib.List.set.

sizeback to summary
public int size()

Implements abstract org.hsqldb.lib.BaseList.size.

Implements org.hsqldb.lib.List.size.

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