ponderToolkit.analyzer.gui.lib.swing.table
Class CellList

java.lang.Object
  |
  +--ponderToolkit.analyzer.gui.lib.swing.table.CellList

public abstract class CellList
extends java.lang.Object

Class for managing a list of objects where elements are added and removed. The operations are frequently required in models for swing components like lists, tables and trees where elements must be removed gradually and the view must be notified of each change. The semantics of the operations are those of a vector


Inner Class Summary
static interface CellList.Handle
           
 
Constructor Summary
protected CellList()
           
 
Method Summary
protected static java.util.Vector _toVector(java.lang.Object[] array)
           
static void add(java.util.Vector vector, CellList.Handle handle, int row, java.lang.Object obj)
          Insert the given element at the given row in the list
static void add(java.util.Vector vector, CellList.Handle handle, java.lang.Object obj)
          Append the given elenent at the end of the list
static void add(java.util.Vector vector, CellList.Handle handle, java.lang.Object[] objs)
          Append the elements at the end of the list.
static void remove(java.util.Vector vector, CellList.Handle handle)
          Remove all elements from the list
static void remove(java.util.Vector vector, CellList.Handle handle, int row)
          Remove the object at the given position of the list
static void remove(java.util.Vector vector, CellList.Handle handle, java.lang.Object obj)
          Remove the first occurence of the object from the list
static void remove(java.util.Vector vector, CellList.Handle handle, java.lang.Object[] objs)
          Remove the elements in the array from the list.
static void set(java.util.Vector vector, CellList.Handle handle, int row, java.lang.Object obj)
          Set the value at the given position
static void set(java.util.Vector vector, CellList.Handle handle, java.lang.Object[] objs)
          Set the elements in the list.
static void update(java.util.Vector vector, CellList.Handle handle, java.lang.Object[] objs)
          Add and remove elements as necessary to make list up-to-date with given array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellList

protected CellList()
Method Detail

_toVector

protected static java.util.Vector _toVector(java.lang.Object[] array)

set

public static void set(java.util.Vector vector,
                       CellList.Handle handle,
                       int row,
                       java.lang.Object obj)
Set the value at the given position
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
row - the row to update. If row >= element count, do nothing
obj - the object to set at the given row

add

public static void add(java.util.Vector vector,
                       CellList.Handle handle,
                       java.lang.Object[] objs)
Append the elements at the end of the list. Handler.preAdd()/postAdd() are called.
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
objs - add all the elements of the array in the list

add

public static void add(java.util.Vector vector,
                       CellList.Handle handle,
                       java.lang.Object obj)
Append the given elenent at the end of the list
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
obj - the object to append to the list

add

public static void add(java.util.Vector vector,
                       CellList.Handle handle,
                       int row,
                       java.lang.Object obj)
Insert the given element at the given row in the list
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
row - the row to insert the element to. If row >= element count, append to the end of the list
obj - the object to insert

remove

public static void remove(java.util.Vector vector,
                          CellList.Handle handle)
Remove all elements from the list
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions

remove

public static void remove(java.util.Vector vector,
                          CellList.Handle handle,
                          java.lang.Object[] objs)
Remove the elements in the array from the list. Handler.preRemove()/postRemove() are called.
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
objs - remove all the elements of the array from the list

remove

public static void remove(java.util.Vector vector,
                          CellList.Handle handle,
                          java.lang.Object obj)
Remove the first occurence of the object from the list
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
obj - remove the given element from the list

remove

public static void remove(java.util.Vector vector,
                          CellList.Handle handle,
                          int row)
Remove the object at the given position of the list
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
row - remove the element at the given row of the list

set

public static void set(java.util.Vector vector,
                       CellList.Handle handle,
                       java.lang.Object[] objs)
Set the elements in the list. For each added element Handler.preAdd()/postAdd() are called.
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
objs - the array of objects to use to set the list

update

public static void update(java.util.Vector vector,
                          CellList.Handle handle,
                          java.lang.Object[] objs)
Add and remove elements as necessary to make list up-to-date with given array. Handler.preAdd()/postAdd()/preRemove()/postRemove() are called.
Parameters:
vector - the vector to modify
handle - the handle to use for pre/post conditions
objs - the array to synchronize the list with.