JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table.data
Class AbstractVectorDataSource

java.lang.Object
  |
  +--com.klg.jclass.table.data.AbstractDataSource
        |
        +--com.klg.jclass.table.data.AbstractVectorDataSource
All Implemented Interfaces:
JCTableDataModel, Serializable, TableDataModel
Direct Known Subclasses:
JCCachedDataSource, JCVectorDataSource

public abstract class AbstractVectorDataSource
extends AbstractDataSource

The AbstractVectorDataSource abstract class implements the TableDataModel interface and support for block moves, insertions and deletions to Vector.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.klg.jclass.table.data.AbstractDataSource
listeners
 
Constructor Summary
AbstractVectorDataSource()
           
 
Method Summary
protected static Vector createVector()
          Default constructor, constructs a vector with initial capacity of 1 and a growth capacityIncrement of 10.
protected static Vector createVector(int initialCapacity)
          Constructs a vector with the specified initial size and a capacityIncrement of 10
protected static Vector createVector(int initialCapacity, int capacityIncrement)
          Constructs an empty vector with the specified initial capacity and capacity increment.
protected static Vector createVector(Object[] array)
          Creates a JCVector using an array of objects.
protected static Vector createVector(Vector vector)
          Creates a new Vector instance from a Vector.
protected static void removeElementsAt(Vector vector, int index, int length)
          Deletes a block starting at the specified index.
protected static void setElementAt(Vector vector, int index, Object value)
          Sets the element at the specified index to be the specified object.
protected static void strip(Vector vector)
          Trims null values from the end.
 
Methods inherited from class com.klg.jclass.table.data.AbstractDataSource
addTableDataListener, dispose, fireColumnChanged, fireColumnLabelChanged, fireColumnsAdded, fireColumnsDeleted, fireColumnsMoved, fireDataReset, fireNumColumnsChanged, fireNumRowsChanged, fireRowChanged, fireRowDeleted, fireRowLabelChanged, fireRowsAdded, fireRowsMoved, fireTableDataEvent, fireValueChanged, hasListeners, removeTableDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.klg.jclass.util.JCTableDataModel
getNumColumns, getNumRows, getTableColumnLabel, getTableDataItem, getTableRowLabel
 

Constructor Detail

AbstractVectorDataSource

public AbstractVectorDataSource()
Method Detail

createVector

protected static Vector createVector()
Default constructor, constructs a vector with initial capacity of 1 and a growth capacityIncrement of 10.


createVector

protected static Vector createVector(int initialCapacity)
Constructs a vector with the specified initial size and a capacityIncrement of 10

Parameters:
initialCapacity - initial size of vector

createVector

protected static Vector createVector(int initialCapacity,
                                     int capacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment.

Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows. If 0, the capacity of the vector is doubled each time it needs to grow.

createVector

protected static Vector createVector(Vector vector)
Creates a new Vector instance from a Vector. Note that any elements that are Vectors are recursively recreated.

Parameters:
vector - instance to be recreated.

createVector

protected static Vector createVector(Object[] array)
Creates a JCVector using an array of objects. If the array is null, the vector is cleared.

Parameters:
array - array to use as the source for this vector

removeElementsAt

protected static final void removeElementsAt(Vector vector,
                                             int index,
                                             int length)
Deletes a block starting at the specified index. Elements with an index greater than the end point of the block are moved up.

Parameters:
index - the element to remove
length - the number of elements to delete

setElementAt

protected static void setElementAt(Vector vector,
                                   int index,
                                   Object value)
Sets the element at the specified index to be the specified object. The previous element at this position is discarded. In contrast to Vector.setElementAt(), the size of the vector is increased if necessary.

Parameters:
index - the specified index
value - the value set to the element

strip

protected static final void strip(Vector vector)
Trims null values from the end.

See Also:
Vector.trimToSize()

Copyright © 2004 Quest Software Inc..
All rights reserved.