proper.util
Class ProperVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by proper.util.ProperVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class ProperVector
extends java.util.Vector

TODO: make Vector.contains(Object) method less error prone...

Version:
$Revision: 1.1 $
Author:
FracPete
See Also:
Serialized Form

Constructor Summary
ProperVector()
          Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.
ProperVector(java.util.Collection c)
          Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
ProperVector(int initialCapacity)
          Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.
ProperVector(int initialCapacity, int capacityIncrement)
           
 
Method Summary
static void main(java.lang.String[] args)
          for testing only
 java.lang.String toCommaList()
          returns the content in a string representation, each item separated by a comma (and a blank after the comma)
 java.lang.String toCommaList(boolean blank)
          returns the content in a string representation, each item separated by a comma (with an optional blank after the comma)
 
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, 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
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

ProperVector

public ProperVector()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.


ProperVector

public ProperVector(java.util.Collection c)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Parameters:
c - the collection whose elements are to be placed into this vector.

ProperVector

public ProperVector(int initialCapacity,
                    int capacityIncrement)
Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows.

ProperVector

public ProperVector(int initialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.

Parameters:
initialCapacity - the initial capacity of the vector.
Method Detail

toCommaList

public java.lang.String toCommaList()
returns the content in a string representation, each item separated by a comma (and a blank after the comma)

Returns:
the items as comma list

toCommaList

public java.lang.String toCommaList(boolean blank)
returns the content in a string representation, each item separated by a comma (with an optional blank after the comma)

Parameters:
blank - whether a blank is inserted after the comma
Returns:
the items as comma list

main

public static void main(java.lang.String[] args)
for testing only