ch.javasoft.jbase.util
Class TableList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by ch.javasoft.jbase.util.TableList<E>
Type Parameters:
E - The entity (or entry) type of this list and the nested table
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, RandomAccess

public class TableList<E>
extends AbstractList<E>
implements RandomAccess

A TableList is a List wrapping a Table. It serves as simple adapter class from tables to Java's collections framework.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TableList(Table<E> table)
          ConstConstructor with table to be wrapped
 
Method Summary
 boolean add(E e)
           
 void add(int index, E element)
           
 boolean addAll(Collection<? extends E> c)
           
 boolean addAll(int index, Collection<? extends E> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 E get(int index)
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator<E> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<E> listIterator()
           
 E remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 E set(int index, E element)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableList

public TableList(Table<E> table)
ConstConstructor with table to be wrapped

Method Detail

add

public boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface List<E>
Overrides:
add in class AbstractList<E>

add

public void add(int index,
                E element)
Specified by:
add in interface List<E>
Overrides:
add in class AbstractList<E>

addAll

public boolean addAll(Collection<? extends E> c)
Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface List<E>
Overrides:
addAll in class AbstractCollection<E>

addAll

public boolean addAll(int index,
                      Collection<? extends E> c)
Specified by:
addAll in interface List<E>
Overrides:
addAll in class AbstractList<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface List<E>
Overrides:
clear in class AbstractList<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface List<E>
Overrides:
contains in class AbstractCollection<E>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface List<E>
Overrides:
containsAll in class AbstractCollection<E>

get

public E get(int index)
Specified by:
get in interface List<E>
Specified by:
get in class AbstractList<E>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<E>
Overrides:
indexOf in class AbstractList<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface List<E>
Overrides:
isEmpty in class AbstractCollection<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface List<E>
Overrides:
iterator in class AbstractList<E>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<E>
Overrides:
lastIndexOf in class AbstractList<E>

listIterator

public ListIterator<E> listIterator()
Specified by:
listIterator in interface List<E>
Overrides:
listIterator in class AbstractList<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface List<E>
Overrides:
remove in class AbstractCollection<E>

remove

public E remove(int index)
Specified by:
remove in interface List<E>
Overrides:
remove in class AbstractList<E>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface List<E>
Overrides:
removeAll in class AbstractCollection<E>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface List<E>
Overrides:
retainAll in class AbstractCollection<E>

set

public E set(int index,
             E element)
Specified by:
set in interface List<E>
Overrides:
set in class AbstractList<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface List<E>
Specified by:
size in class AbstractCollection<E>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface List<E>
Overrides:
toArray in class AbstractCollection<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface List<E>
Overrides:
toArray in class AbstractCollection<E>