org.hsqldb.lib
Class HsqlDeque

java.lang.Object
  extended byorg.hsqldb.lib.BaseList
      extended byorg.hsqldb.lib.HsqlDeque
All Implemented Interfaces:
HsqlList

public class HsqlDeque
extends org.hsqldb.lib.BaseList
implements HsqlList

jdk 1.1 compatible minimal implementation of a list object suitable for stack, queue and deque usage patterns backed by an Object[]. The memory footprint of the HsqlDeque doubles when it gets full but does not shrink when it gets empty.

Since:
1.7.0
Version:
1.7.2
Author:
fredt@users

Field Summary
protected  int elementCount
           
 
Constructor Summary
HsqlDeque()
           
 
Method Summary
 void add(int i, Object o)
           
 boolean add(Object o)
           
 boolean addFirst(Object o)
           
 boolean addLast(Object o)
           
 void clear()
           
 Object get(int i)
           
 Object getFirst()
           
 Object getLast()
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Object remove(int i)
           
 Object removeFirst()
           
 Object removeLast()
           
 Object set(int i, Object o)
           
 int size()
           
 String toString()
          Returns a string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hsqldb.lib.HsqlList
isEmpty, iterator
 

Field Detail

elementCount

protected int elementCount
Constructor Detail

HsqlDeque

public HsqlDeque()
Method Detail

size

public int size()
Specified by:
size in interface HsqlList

getFirst

public Object getFirst()
                throws NoSuchElementException
Throws:
NoSuchElementException

getLast

public Object getLast()
               throws NoSuchElementException
Throws:
NoSuchElementException

get

public Object get(int i)
           throws IndexOutOfBoundsException
Specified by:
get in interface HsqlList
Throws:
IndexOutOfBoundsException

remove

public Object remove(int i)
Specified by:
remove in interface HsqlList

add

public void add(int i,
                Object o)
         throws IndexOutOfBoundsException
Specified by:
add in interface HsqlList
Throws:
IndexOutOfBoundsException

set

public Object set(int i,
                  Object o)
           throws IndexOutOfBoundsException
Specified by:
set in interface HsqlList
Throws:
IndexOutOfBoundsException

removeFirst

public Object removeFirst()
                   throws NoSuchElementException
Throws:
NoSuchElementException

removeLast

public Object removeLast()
                  throws NoSuchElementException
Throws:
NoSuchElementException

add

public boolean add(Object o)
Specified by:
add in interface HsqlList

addLast

public boolean addLast(Object o)

addFirst

public boolean addFirst(Object o)

clear

public void clear()

isEmpty

public boolean isEmpty()

toString

public String toString()
Returns a string representation


iterator

public Iterator iterator()


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.