util
Class MyVector

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--util.MyVector
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class MyVector
extends java.util.Vector

MyVector is a one-method extension of java.util.Vector, one of Java's best-loved utility classes. The point of MyVector is that it allows random deletion of elements from the Vector. Hopefully something similar will be supported by the standard Java class libraries at some point.

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MyVector()
          This, and all the other constructors are the same as for Vector.
MyVector(java.util.Collection c)
           
MyVector(int initialCapacity)
           
MyVector(int initialCapacity, int capacityIncrement)
           
 
Method Summary
 java.lang.Object randomRemove()
          Removes a random object from the list, and returns the object.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

MyVector

public MyVector()
This, and all the other constructors are the same as for Vector.

MyVector

public MyVector(java.util.Collection c)

MyVector

public MyVector(int initialCapacity)

MyVector

public MyVector(int initialCapacity,
                int capacityIncrement)
Method Detail

randomRemove

public java.lang.Object randomRemove()
Removes a random object from the list, and returns the object. The low-quality Math.random() randomizer is used.