borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.model 

VectorSelection interface

borland.jbcl.model.VectorSelection
   +----borland.jbcl.model.WritableVectorSelection

About the VectorSelection interface

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.


VectorSelection methods

Methods defined in this interface


VectorSelection methods

addSelectionListener(borland.jbcl.model.VectorSelectionListener)

  void addSelectionListener(borland.jbcl.model.VectorSelectionListener listener)
Adds a vector-selection event listener to the set of selected locations.

Parameters:

listener
The object that implements the VectorSelectionListener interface and that responds to vector-selection events.

contains(int)

  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
The position of the location in question in the list of data items in the vector. Specify the location as an integer. For example, if you want to know if the third item in the vector is selected, specify the value of location as 2 (the data items are held in a zero-based array).

getAll()

  int[]getAll()
Returns the complete set of selected locations.

getCount()

  int getCount()
Returns the number of selected locations.

removeSelectionListener(borland.jbcl.model.VectorSelectionListener)

  void removeSelectionListener(borland.jbcl.model.VectorSelectionListener listener)
Removes a selection-event listener from the set of selected locations.

Parameters:

listener
The listening object that is removed.