All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.util.JCVector

java.lang.Object
   |
   +----java.util.Vector
           |
           +----jclass.util.JCVector

public class JCVector
extends Vector
Adds block moves, insertions and deletions to Vector.

See Also:
Vector

Constructor Index

 o JCVector()
Default constructor, constructs a vector with initial capacity of 1 and a growth increment of 10.
 o JCVector(int)
Constructs a vector with a particular initial size
 o JCVector(Object[])
Creates a JCVector using an array of objects.
 o JCVector(Vector)
Creates an instance from a Vector.

Method Index

 o add(Object)
Adds the specified object as the last element of the vector, if it is not already a member.
 o copyFrom(Object[])
Sets the vector to the elements of the array.
 o equals(JCVector)
Checks to see if two vectors are equal.
 o getArrayCopy()
Returns a copy of the internal array.
 o getFirst()
Returns the first element of the sequence, or null if the vector is empty.
 o getLast()
Returns the last element of the sequence, or null if the vector is empty.
 o removeElementsAt(int, int)
Deletes a block starting at the specified index.
 o setElementAt(int, Object)
Sets the element at the specified index to be the specified object.
 o setMinSize(int)
Sets the minimum size of the vector.
 o strip()
Trims null values from the end.

Constructors

 o JCVector
 public JCVector(int initialCapacity)
Constructs a vector with a particular initial size

Parameters:
initialCapacity - initial size of vector
 o JCVector
 public JCVector(Vector vector)
Creates an instance from a Vector. Note that any elements that are Vectors are also converted to JCVector.

Parameters:
vector - Vector instance to be converted to a JCVector
 o JCVector
 public JCVector()
Default constructor, constructs a vector with initial capacity of 1 and a growth increment of 10.

 o JCVector
 public JCVector(Object array[])
Creates a JCVector using an array of objects.

Parameters:
array - an array to use as the source for this vector

Methods

 o add
 public synchronized void add(Object obj)
Adds the specified object as the last element of the vector, if it is not already a member.

 o equals
 public boolean equals(JCVector v)
Checks to see if two vectors are equal.

Parameters:
v - the vector to be compared against
Returns:
returns true if this vector is identical to the provided vector
 o removeElementsAt
 public final synchronized void removeElementsAt(int index,
                                                 int length)
Deletes a block starting at the specified index. Elements with an index greater than the end point of the block are moved up.

Parameters:
index - the element to remove
length - the number of elements to delete
 o setElementAt
 public synchronized void setElementAt(int index,
                                       Object value)
Sets the element at the specified index to be the specified object. The previous element at this position is discarded. In contrast to Vector.setElementAt(), the size of the vector is increased if necessary.

Parameters:
index - the specified index
value - the value set to the element
 o setMinSize
 public final synchronized void setMinSize(int newSize)
Sets the minimum size of the vector. If the size increases, new elements are set to null.

Parameters:
newSize - the new size of the vector
 o strip
 public void strip()
Trims null values from the end.

 o getArrayCopy
 public Object[] getArrayCopy()
Returns a copy of the internal array.

Returns:
Object the array used by this instance of JCVector
 o copyFrom
 public final synchronized void copyFrom(Object anArray[])
Sets the vector to the elements of the array. If the array is null, the vector is cleared.

Parameters:
anArray - new elements for this vector
 o getFirst
 public final synchronized Object getFirst()
Returns the first element of the sequence, or null if the vector is empty.

 o getLast
 public final synchronized Object getLast()
Returns the last element of the sequence, or null if the vector is empty.


All Packages  Class Hierarchy  This Package  Previous  Next  Index