    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

##

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

##

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

##

JCVector

     public JCVector(int initialCapacity)

  Constructs a vector with a particular initial size

  Parameters:
    initialCapacity - initial size of vector

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

JCVector

     public JCVector()

  Default constructor, constructs a vector with initial capacity of 1 and a growth increment of 10.

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

##

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.

at

     public final synchronized Object at(int index)

  Returns the component at the specified index.

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

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

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

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

strip

     public final synchronized void strip()

  Trims null values from the end.

getArrayCopy

     public final synchronized Object[] getArrayCopy()

  Returns a copy of the internal array.

  Returns:
    Object the array used by this instance of JCVector

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

getFirst

     public final synchronized Object getFirst()

  Returns the first element of the sequence, or null if the vector is empty.

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