jbcl.model Package
java.lang.Object +----com.borland.jbcl.model.BasicVectorContainer
Constructors Properties Methods Event Listeners
Implements VectorModel, WritableVectorModel, Serializable
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.
public BasicVectorContainer()Constructs a
BasicVectorContainer
with default property values. The Array
inside the container is empty.
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
public BasicVectorContainer(int size, 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
object
public BasicVectorContainer(Object[] newArray)Constructs a
BasicVectorContainer
holding the array of objects specified in newArray
.
Parameters:
newArray
public int getCount() public void setCount(int count)Used to obtain and specify the number of items in the list.
Parameters:
count
public Object[] getItems() public void setItems(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
public boolean isVariableSize() public void setVariableSize(boolean variable)Determines whether the capacity of the container can be changed. Default setting is true.
Parameters:
variable
public Vector getVector()Returns the
Vector
object.
public Enumeration begin()Returns an object that uses an
Enumeration
interface positioned at the first item in the array.
protected void processModelEvent(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.
public void addModelListener(VectorModelListener listener) public void removeModelListener(VectorModelListener listener)