Class HsqlDeque<E>
java.lang.Object
org.hsqldb.lib.HsqlDeque<E>
- All Implemented Interfaces:
Collection<E>, List<E>
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.
- Since:
- 1.7.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanbooleanaddAll(Collection<? extends E> other) voidvoidvoidclear()booleanelement()get(int i) getFirst()getLast()intbooleanisEmpty()iterator()intlastIndexOf(E value) booleanbooleanofferFirst(E e) booleanpeek()peekLast()poll()pollLast()pop()voidremove()remove(int index) booleanbooleanbooleanintsize()Object[]toArray()<T> T[]toArray(T[] array) toString()Methods inherited from interface Collection
addAll
-
Constructor Details
-
HsqlDeque
public HsqlDeque()
-
-
Method Details
-
size
-
offer
-
remove
-
poll
-
element
-
peek
-
push
-
pop
-
getFirst
- Throws:
NoSuchElementException
-
getLast
- Throws:
NoSuchElementException
-
get
- Specified by:
getin interfaceList<E>- Throws:
IndexOutOfBoundsException
-
add
- Specified by:
addin interfaceList<E>- Throws:
IndexOutOfBoundsException
-
set
- Specified by:
setin interfaceList<E>- Throws:
IndexOutOfBoundsException
-
removeFirst
- Throws:
NoSuchElementException
-
removeLast
- Throws:
NoSuchElementException
-
peekFirst
-
peekLast
-
offerFirst
-
offerLast
-
pollFirst
-
pollLast
-
removeFirstOccurrence
-
removeLastOccurrence
-
descendingIterator
-
add
-
addLast
-
addFirst
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>
-
indexOf
-
contains
- Specified by:
containsin interfaceCollection<E>
-
remove
- Specified by:
removein interfaceCollection<E>
-
lastIndexOf
-
remove
-
toArray
public <T> T[] toArray(T[] array) -
toArray
-
addAll
-
addAll
-
isEmpty
public boolean isEmpty() -
toString
-
iterator
-