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

BasicVectorContainer component

java.lang.Object
   +----borland.jbcl.model.BasicVectorContainer

About the BasicVectorContainer component

Constructors  Properties  Methods  Event Listeners

Implements VectorModel, WritableVectorModel

This container provides read-write access to data items stored in a single-dimension array, such as that used by a list. Use this container object in composing new model-view components that need a simple read-write model. BasicVectorContainer uses a jgl.Array to store the data items.


BasicVectorContainer constructors

BasicVectorContainer properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

BasicVectorContainer methods

Methods implemented in this class

Methods implemented in java.lang.Object

BasicVectorContainer event listeners


BasicVectorContainer constructors

BasicVectorContainer()

  public BasicVectorContainer()
Constructs a BasicVectorContainer with default property values. The Array inside the container is empty.

BasicVectorContainer(COM.objectspace.jgl.Array)

  public BasicVectorContainer(COM.objectspace.jgl.Array newArray)
Constructs a BasicVectorContainer holding a copy of the existing Array passed as the newArray argument.

Parameters:

newArray
An array that contains the data items.

BasicVectorContainer(int)

  public BasicVectorContainer(int size)
Constructs a BasicVectorContainer with a capacity specified by the size argument. The array is empty; data items must be added before the container component can be used.

Parameters:

size
The number of data items the container can hold.

BasicVectorContainer(int, java.lang.Object)

  public BasicVectorContainer(int size, java.lang.Object object)
Constructs a BasicVectorContainer of a capacity specified by the size argument. Creates the internal Array as an array of objects of the same type as passed in the object argument.

Parameters:

size
The number of data items the container can hold.
object
The data type of the array of objects.

BasicVectorContainer(java.lang.Object[])

  public BasicVectorContainer(java.lang.Object[] newArray)
Constructs a BasicVectorContainer holding the array of objects specified in newArray.

Parameters:

newArray
An array of data items.

BasicVectorContainer properties

array

 public Array getArray()
Read-only property that specifies the jgl.Array object in the container that actually stores the data items.

count

 public int getCount()
 public void setCount(int count)
Used to obtain and specify the number of items in the list.

Parameters:

count
Specify the number of items in the list.

items

 public Object[] getItems()
 public void setItems(java.lang.Object[] newItems)
Returns and specifies the data items stored in the container. If you need a simple list, with no complex functionality or database connectvity, use setItems() to store items directly into the container's array. Calling setItems() generates a modelStructureChanged event.

Parameters:

newItems
The data items stored in the container.

variableSize

 public boolean isVariableSize()
 public void setVariableSize(boolean variable)
Determines whether the capacity of the container can be changed. Default setting is true.

Parameters:

variable
Specify true if the capacity of the container can change; otherwise, specify false.

BasicVectorContainer methods

begin()

  public ArrayIterator begin()
Returns an ArrayIterator positioned at the first item in the array.

end()

  public ArrayIterator end()
Returns an ArrayIterator positioned at the last item in the array.

processModelEvent(borland.jbcl.model.VectorModelEvent)

  protected void processModelEvent(borland.jbcl.model.VectorModelEvent e)
This method is called when a model event occurs in the container component. It sends a copy of the event object to registered listeners for these events.

BasicVectorContainer event listeners

This component is a source for the following event sets. For information on the JBCL event sets, see Events in JBCL.

model

 public void addModelListener(borland.jbcl.model.VectorModelListener listener)
 public void removeModelListener(borland.jbcl.model.VectorModelListener listener)