jbcl.model Package
com.borland.jbcl.model.VectorSelection +----com.borland.jbcl.model.WritableVectorSelection
Methods
Implemented by BasicVectorSelection, NullVectorSelection, SingleVectorSelection
The VectorSelection
interface provides read access to the set of selected locations within the vector model. It contains a count
property that holds the number of selected locations. Use the contains()
method to determine if a specific location is currently selected and the getAll
() method to return all selected locations.
Classes that implement the VectorSelection
interface are usually used to pass selection sets. Usually you will use one of the vector-selection classes, such as BasicVectorSelection
, NullVectorSelection
, or SingleVectorSelection
, but you can implement the VectorSelection
interface directly.
If you need an interface that provides read-write access to the set of selected locations within the vector, use the WritableVectorSelection
interface instead.
void addSelectionListener(VectorSelectionListener listener)Adds a vector-selection event listener to the set of selected locations.
Parameters:
listener
VectorSelectionListener
interface and that responds to vector-selection events.
boolean contains(int location)Determines whether a particular location where a data item is stored in the vector is selected. If
contains()
is true, the specified location is in the selection set and is therefore selected. If contains()
is false, the location is not selected.
Parameters:
location
location
as 2 (the data items are held in a zero-based array).
int[] getAll()Returns the complete set of selected locations.
int getCount()Returns the number of selected locations.
void removeSelectionListener(VectorSelectionListener listener)Removes a selection-event listener from the set of selected locations.
Parameters:
listener