borland Packages  Class Hierarchy  jbcl.model Package  Index 

WritableVectorSelection interface

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

About the WritableVectorSelection interface

Methods  

Implemented by BasicVectorSelection, NullVectorSelection, SingleVectorSelection

The WritableVectorSelection interface provides read-write access to the set of selected locations within a vector model. Usually it is used to manage the selection set.

Most of the time you will use classes that implement WritableVectorSelection, such as BasicVectorSelection, NullVectorSelection, and SingleVectorSelection. You can implement the interface directly, however.

If you need read access only to a set of selected locations, you can use the VectorSelection interface instead.

To add locations to the set of selected locations, call one of the add() methods or use the addRange() method. To delete locations from the selection pool, call one of the remove() methods, the removeRange() method, or the removeAll() method. Set a selection pool all at once with the set() method.


WritableVectorSelection methods

Methods defined in this interface

Methods implemented in borland.jbcl.model.VectorSelection


WritableVectorSelection methods

add(int)

  void add(int location)
Adds the location of a data item in the vector to the set of selected locations.

Parameters:

location
A zero-based index that specifies the location of the data item that is added to the set of selected locations.

add(int[])

  void add(int[] locations)
Adds multiple locations to the set of selected locations.

Parameters:

locations
An array of indexes that specify the locations of data items that are added to the set of selected locations. The indexes are zero-based.

addRange(int, int)

  void addRange(int begin, int end)
Adds a range of locations to the set of selected locations.

Parameters:

begin
The first location in the range. The location is a zero-based index that indicates the position of the data item in the vector.
end
The final location in the range.

enableSelectionEvents(boolean)

  void enableSelectionEvents(boolean enable)
Determines whether the broadcasting of vector-selection events is enabled or disabled based on the value of the enable parameter.

Parameters:

enable
If enable is true, vector-selection events are enabled and a SELECTION_CHANGED event is fired to all vector-selection listeners. If enable is false, all vector-selection events are disabled.

remove(int)

  void remove(int location)
Removes the specified location from the set of selected locations.

Parameters:

location
A zero-based index that specifies the location of the data item in the vector.

remove(int[])

  void remove(int[] locations)
Removes a specified array of locations from the set of selected locations.

Parameters:

locations
An array of zero-based indexes that specify locations of data items within the vector.

removeAll()

  void removeAll()
Removes all locations from the set of selected locations.

removeRange(int, int)

  void removeRange(int begin, int end)
Removes a specified range of locations from the set of selected locations.

Parameters:

begin
The first location in the range. The location is a zero-based index that indicates the position of the data item in the vector.
end
The final location in the range.

set(int[])

  void set(int[] locations)
Sets the selection pool to a given set of locations

Parameters:

locations
An array of zero-based indexes that specifies the new set of selected locations within the vector.