- java.lang.Object
-
- org.hsqldb.lib.HsqlDeque<E>
-
- All Implemented Interfaces:
Collection<E>,List<E>
public class HsqlDeque<E> extends java.lang.Object implements List<E>
AList<E>that also implementsDeque<E>andQueue<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()andpop()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 Constructor Description HsqlDeque()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int i, E o)booleanadd(E o)booleanaddAll(E[] array)booleanaddAll(Collection<? extends E> other)voidaddFirst(E o)voidaddLast(E o)voidclear()booleancontains(java.lang.Object value)Iterator<E>descendingIterator()Eelement()Eget(int i)EgetFirst()EgetLast()intindexOf(E value)booleanisEmpty()Iterator<E>iterator()intlastIndexOf(E value)booleanoffer(E e)booleanofferFirst(E e)booleanofferLast(E e)Epeek()EpeekFirst()EpeekLast()Epoll()EpollFirst()EpollLast()Epop()voidpush(E e)Eremove()Eremove(int index)booleanremove(E value)EremoveFirst()booleanremoveFirstOccurrence(E o)EremoveLast()booleanremoveLastOccurrence(E o)Eset(int i, E o)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] array)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hsqldb.lib.Collection
addAll
-
-
-
-
Method Detail
-
size
public int size()
-
offer
public boolean offer(E e)
-
remove
public E remove()
-
poll
public E poll()
-
element
public E element()
-
peek
public E peek()
-
push
public void push(E e)
-
pop
public E pop()
-
getFirst
public E getFirst() throws java.util.NoSuchElementException
- Throws:
java.util.NoSuchElementException
-
getLast
public E getLast() throws java.util.NoSuchElementException
- Throws:
java.util.NoSuchElementException
-
get
public E get(int i) throws java.lang.IndexOutOfBoundsException
-
add
public void add(int i, E o) throws java.lang.IndexOutOfBoundsException
-
removeFirst
public E removeFirst() throws java.util.NoSuchElementException
- Throws:
java.util.NoSuchElementException
-
removeLast
public E removeLast() throws java.util.NoSuchElementException
- Throws:
java.util.NoSuchElementException
-
peekFirst
public E peekFirst()
-
peekLast
public E peekLast()
-
offerFirst
public boolean offerFirst(E e)
-
offerLast
public boolean offerLast(E e)
-
pollFirst
public E pollFirst()
-
pollLast
public E pollLast()
-
removeFirstOccurrence
public boolean removeFirstOccurrence(E o)
-
removeLastOccurrence
public boolean removeLastOccurrence(E o)
-
add
public boolean add(E o)
-
addLast
public void addLast(E o)
-
addFirst
public void addFirst(E o)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>
-
indexOf
public int indexOf(E value)
-
contains
public boolean contains(java.lang.Object value)
- Specified by:
containsin interfaceCollection<E>
-
remove
public boolean remove(E value)
- Specified by:
removein interfaceCollection<E>
-
lastIndexOf
public int lastIndexOf(E value)
-
toArray
public <T> T[] toArray(T[] array)
-
toArray
public java.lang.Object[] toArray()
-
addAll
public boolean addAll(Collection<? extends E> other)
-
addAll
public boolean addAll(E[] array)
-
isEmpty
public boolean isEmpty()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
iterator
public Iterator<E> iterator()
-
-