Class jgl.VectorArray
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jgl.VectorArray

java.lang.Object
   |
   +----jgl.ArrayAdapter
           |
           +----jgl.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 like Sorting.sort() to a java.util.Vector.


Constructor Index

 o VectorArray(Vector)
 o VectorArray(VectorArray)

Method Index

 o add(Object)
Add an object to myself.
 o at(int)
Return the object at the specified index.
 o clear()
Remove all of my objects.
 o clone()
Return a shallow copy of myself.
 o elements()
Return an Enumeration of my elements.
 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 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 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(Vector vector)
 o VectorArray
  public VectorArray(VectorArray vector)

Methods

 o clone
  public Object clone()
Return a shallow copy of myself.
Overrides:
clone in class Object
 o toString
  public 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 Object
 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 finish
  public ForwardIterator finish()
Return an iterator positioned immediately after my last item.
Overrides:
finish in class ArrayAdapter
 o at
  public Object at(int index)
Return the object at the specified index.
Parameters:
index - The index.
Overrides:
at in class ArrayAdapter
 o put
  public 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 Object add(Object object)
Add an object to myself.
Overrides:
add in class ArrayAdapter
 o pushFront
  public 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 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 Object popBack()
Remove and return my last element.
Overrides:
popBack in class ArrayAdapter
 o remove
  public 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.
Overrides:
remove in class ArrayAdapter
 o remove
  public 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.
Throws: IndexOutOfBoundsException
If either index is invalid.
Overrides:
remove in class ArrayAdapter

All Packages  Class Hierarchy  This Package  Previous  Next  Index