jbcl.model Package
com.borland.jbcl.model.VectorModel +----com.borland.jbcl.model.WritableVectorModel
Properties Methods Event Listeners
Implemented by ListControl, AbstractVectorModel, BasicVectorContainer, VectorDataSetManager, DefaultColumnHeaderManager, DefaultRowHeaderManager
Contains the methods required for a read-only model object that holds vector data. A vector model holds data in a one-dimensional array like a list. For example, list controls implement the vector model.
The VectorModel
interface has a count
property that holds the number of data items contained in the model. Use the get()
method to locate a data item when you know the index of the data item. Or you can use find()
to obtain the index of a data item in the model if you know what the data item is.
Usually you extend a class that implements this interface, such as
BasicVectorContainer
. You can, however, implement the interface directly.
If you are developing a read-and-write component that holds vector data, implement the WritableVectorModel
interface instead of VectorModel
.
public int getCount()Returns a count of the data items in the model.
public int find(Object data)Returns the storage index of the passed data object. The index, which is zero-based, indicates the position of the data object in the model. If the specified data object cannot be found,
find()
returns -1.
Parameters:
data
public Object get(int index)Returns the data object at the specified index position.
Parameters:
index
public void addModelListener(VectorModelListener listener) public void removeModelListener(VectorModelListener listener)