net.rim.device.api.util
Class CloneableVector

java.lang.Object
  extended by java.util.Vector
      extended by net.rim.device.api.util.CloneableVector

public class CloneableVector
extends Vector

A vector that can provide a clone of itself.

CLDC's vector implementation cannot clone itself, so we provide this derived class that can.


Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
CloneableVector()
          Constructs a new CloneableVector instance.
CloneableVector(int initialCapacity)
          Constructs a new CloneableVector instance with your provided initial capacity.
CloneableVector(int initialCapacity, int capacityIncrement)
          Constructs a new CloneableVector instance with your provided initial capacity and capacity increment.
 
Method Summary
 Object clone()
          Retreives a clone of this vector.
static Vector clone(Vector vector)
          Makes a clone of provided vector.
 
Methods inherited from class java.util.Vector
addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Constructor Detail

CloneableVector

public CloneableVector(int initialCapacity,
                       int capacityIncrement)
Constructs a new CloneableVector instance with your provided initial capacity and capacity increment.

Parameters:
initialCapacity - Initial capacity of the vector.
capacityIncrement - Additional capacity added to the vector each time it overflows.
Throws:
IllegalArgumentException - If initial capacity is less than zero.

CloneableVector

public CloneableVector(int initialCapacity)
Constructs a new CloneableVector instance with your provided initial capacity.

This builds a cloneable vector with your provided initial capacity, and a capacity increment of zero.

Parameters:
initialCapacity - Initial capacity of the vector.
Throws:
IllegalArgumentException - If initial capacity is less than zero.

CloneableVector

public CloneableVector()
Constructs a new CloneableVector instance.

This builds a cloneable vector with an initial capacity of 4, and a capacity increment of zero.



Method Detail

clone

public Object clone()
Retreives a clone of this vector.

Returns:
Clone of this vector.

clone

public static final Vector clone(Vector vector)
Makes a clone of provided vector.

Parameters:
vector - Vector to clone.
Returns:
Clone of provided vector.





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.