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, 20020130
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection c) boolean
boolean
addAll
(Collection<? extends E> other) void
void
void
clear()
boolean
boolean
element()
get
(int i) getFirst()
getLast()
int
boolean
isEmpty()
iterator()
int
lastIndexOf
(Object value) boolean
boolean
offerFirst
(E e) boolean
peek()
peekLast()
poll()
pollLast()
pop()
void
remove()
remove
(int index) boolean
boolean
boolean
boolean
boolean
int
size()
subList
(int fromIndex, int toIndex) Object[]
toArray()
<T> T[]
toArray
(T[] array) toString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hsqldb.lib.Collection
addAll, contains, remove
-
Constructor Details
-
HsqlDeque
public HsqlDeque()
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
offer
-
remove
-
poll
-
element
-
peek
-
push
-
pop
-
getFirst
- Throws:
NoSuchElementException
-
getLast
- Throws:
NoSuchElementException
-
get
- Specified by:
get
in interfaceList<E>
- Throws:
IndexOutOfBoundsException
-
add
- Specified by:
add
in interfaceList<E>
- Throws:
IndexOutOfBoundsException
-
set
- Specified by:
set
in 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:
clear
in interfaceCollection<E>
-
indexOf
-
lastIndexOf
-
remove
-
toArray
public <T> T[] toArray(T[] array) -
toArray
-
subList
-
containsAll
-
removeAll
-
retainAll
-
addAll
-
contains
-
remove
-
addAll
-
addAll
-
toString
-
iterator
-