All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.adapters.VectorArray

java.lang.Object
   |
   +----COM.objectspace.jgl.adapters.ArrayAdapter
           |
           +----COM.objectspace.jgl.adapters.VectorArray

public class VectorArray
extends ArrayAdapter
VectorArray allows a java.util.Vector to be accessed like a Container. It is particularly useful for applying generic algorithms such as Sorting.sort() to a java.util.Vector.

See Also:
Vector

Constructor Index

 o VectorArray()
Construct myself to refer to an empty array.
 o VectorArray(Vector)
Construct myself to refer to a java.util.Vector.
 o VectorArray(VectorArray)
Construct myself to refer to an existing VectorArray.

Method Index

 o add(Object)
Add an object to myself.
 o at(int)
Return the object at the specified index.
 o begin()
Return an iterator positioned at my first item.
 o clear()
Remove all of my objects.
 o clone()
Return a shallow copy of myself.
 o elements()
Return an Enumeration of my elements.
 o end()
Return an iterator positioned immediately after my last item.
 o equals(Object)
Return true if I'm equal to a specified object.
 o finish()
Return an iterator positioned immediately after my last item.
 o get()
Retrieve the underlying Vector.
 o maxSize()
Return the maximum number of objects that I can contain.
 o popBack()
Remove and return my last element.
 o popFront()
Remove and return my first element.
 o pushBack(Object)
Add an object at my end.
 o pushFront(Object)
Insert an object in front of my first element.
 o put(int, Object)
Set the object at a specified index.
 o remove(int, int, Object)
Remove all elements within a specified range that match a particular object and return the number of objects that were removed.
 o remove(Object)
Remove all elements that match a specified object and return the number of objects that were removed.
 o remove(Object, int)
Remove at most a given number of elements that match a specified object and return the number of objects that were removed.
 o size()
Return the number of objects that I contain.
 o start()
Return an iterator positioned at my first item.
 o toString()
Return a string that describes me.

Constructors

 o VectorArray
 public VectorArray()
Construct myself to refer to an empty array.

 o VectorArray
 public VectorArray(Vector vector)
Construct myself to refer to a java.util.Vector.

Parameters:
array - The Vector to ape.
 o VectorArray
 public VectorArray(VectorArray vector)
Construct myself to refer to an existing VectorArray.

Parameters:
array - The VectorArray to copy.

Methods

 o clone
 public synchronized Object clone()
Return a shallow copy of myself.

Overrides:
clone in class ArrayAdapter
 o toString
 public synchronized String toString()
Return a string that describes me.

Overrides:
toString in class Object
 o equals
 public boolean equals(Object object)
Return true if I'm equal to a specified object.

Parameters:
object - The object to compare myself against.
Returns:
true if I'm equal to the specified object.
Overrides:
equals in class ArrayAdapter
 o get
 public Vector get()
Retrieve the underlying Vector.

 o size
 public int size()
Return the number of objects that I contain.

Overrides:
size in class ArrayAdapter
 o maxSize
 public int maxSize()
Return the maximum number of objects that I can contain.

Overrides:
maxSize in class ArrayAdapter
 o elements
 public Enumeration elements()
Return an Enumeration of my elements.

Overrides:
elements in class ArrayAdapter
 o start
 public ForwardIterator start()
Return an iterator positioned at my first item.

Overrides:
start in class ArrayAdapter
 o begin
 public synchronized VectorIterator begin()
Return an iterator positioned at my first item.

 o finish
 public ForwardIterator finish()
Return an iterator positioned immediately after my last item.

Overrides:
finish in class ArrayAdapter
 o end
 public synchronized VectorIterator end()
Return an iterator positioned immediately after my last item.

 o at
 public synchronized Object at(int index)
Return the object at the specified index.

Parameters:
index - The index.
Overrides:
at in class ArrayAdapter
 o put
 public synchronized void put(int index,
                              Object object)
Set the object at a specified index. The object must be a Integer

Parameters:
index - The index.
object - The object to place at the specified index.
Throws: IndexOutOfBoundsException
if index is not in range.
Overrides:
put in class ArrayAdapter
 o clear
 public void clear()
Remove all of my objects.

Overrides:
clear in class ArrayAdapter
 o add
 public synchronized Object add(Object object)
Add an object to myself.

Overrides:
add in class ArrayAdapter
 o pushFront
 public synchronized void pushFront(Object object)
Insert an object in front of my first element.

Parameters:
object - The object to insert.
Overrides:
pushFront in class ArrayAdapter
 o popFront
 public synchronized Object popFront()
Remove and return my first element.

Overrides:
popFront in class ArrayAdapter
 o pushBack
 public void pushBack(Object object)
Add an object at my end.

Parameters:
object - The object to add.
Overrides:
pushBack in class ArrayAdapter
 o popBack
 public synchronized Object popBack()
Remove and return my last element.

Overrides:
popBack in class ArrayAdapter
 o remove
 public synchronized int remove(Object object)
Remove all elements that match a specified object and return the number of objects that were removed.

Parameters:
object - The object to remove.
Returns:
The number of objects removed.
Overrides:
remove in class ArrayAdapter
 o remove
 public synchronized int remove(Object object,
                                int count)
Remove at most a given number of elements that match a specified object and return the number of objects that were removed.

Parameters:
object - The object to remove.
count - The maximum number of objects to remove.
Returns:
The number of objects removed.
Overrides:
remove in class ArrayAdapter
 o remove
 public synchronized int remove(int first,
                                int last,
                                Object object)
Remove all elements within a specified range that match a particular object and return the number of objects that were removed.

Parameters:
first - The index of the first object to remove.
last - The index of the last object to remove.
object - The object to remove.
Returns:
The number of objects removed.
Throws: IndexOutOfBoundsException
If either index is invalid.
Overrides:
remove in class ArrayAdapter

All Packages  Class Hierarchy  This Package  Previous  Next  Index