java.util

Class Vector<E>

Implemented Interfaces:
Cloneable, Collection<E>, Iterable<T>, List<E>, RandomAccess, Serializable
Known Direct Subclasses:
SnmpVarBindList, Stack<E>

public class Vector<E>
extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, Serializable

The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created.

Each vector tries to optimize storage management by maintaining a capacity and a capacityIncrement. The capacity is always at least as large as the vector size; it is usually larger because as components are added to the vector, the vector's storage increases in chunks the size of capacityIncrement. An application can increase the capacity of a vector before inserting a large number of components; this reduces the amount of incremental reallocation.

As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized.

The Iterators returned by Vector's iterator and listIterator methods are fail-fast: if the Vector is structurally modified at any time after the Iterator is created, in any way except through the Iterator's own remove or add methods, the Iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the Iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future. The Enumerations returned by Vector's elements method are not fail-fast.

Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.

This class is a member of the ../../../guide/collections/index.html"> Java Collections Framework.

Since:
JDK1.0
See Also:
Collection, List, ArrayList, LinkedList, Serialized Form

Field Summary

protected int
capacityIncrement
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity.
protected int
elementCount
The number of valid components in this Vector object.
protected Object[]
elementData
The array buffer into which the components of the vector are stored.

Fields inherited from class java.util.AbstractList<E>

modCount

Constructor Summary

Vector()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.
Vector(E> c)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Vector(int initialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.
Vector(int initialCapacity, int capacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment.

Method Summary

T[] toArray(T[] a)
Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
boolean
add(E o)
Appends the specified element to the end of this Vector.
void
add(int index, E element)
Inserts the specified element at the specified position in this Vector.
boolean
addAll(E> c)
Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.
boolean
addAll(int index, E> c)
Inserts all of the elements in the specified Collection into this Vector at the specified position.
void
addElement(E obj)
Adds the specified component to the end of this vector, increasing its size by one.
int
capacity()
Returns the current capacity of this vector.
void
clear()
Removes all of the elements from this Vector.
Object
clone()
Returns a clone of this vector.
boolean
contains(Object elem)
Tests if the specified object is a component in this vector.
boolean
containsAll(Collection c)
Returns true if this Vector contains all of the elements in the specified Collection.
void
copyInto(Object[] anArray)
Copies the components of this vector into the specified array.
E
elementAt(int index)
Returns the component at the specified index.
Enumeration
elements()
Returns an enumeration of the components of this vector.
void
ensureCapacity(int minCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
boolean
equals(Object o)
Compares the specified Object with this Vector for equality.
E
firstElement()
Returns the first component (the item at index 0) of this vector.
E
get(int index)
Returns the element at the specified position in this Vector.
int
hashCode()
Returns the hash code value for this Vector.
int
indexOf(Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.
int
indexOf(Object elem, int index)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
void
insertElementAt(E obj, int index)
Inserts the specified object as a component in this vector at the specified index.
boolean
isEmpty()
Tests if this vector has no components.
E
lastElement()
Returns the last component of the vector.
int
lastIndexOf(Object elem)
Returns the index of the last occurrence of the specified object in this vector.
int
lastIndexOf(Object elem, int index)
Searches backwards for the specified object, starting from the specified index, and returns an index to it.
E
remove(int index)
Removes the element at the specified position in this Vector.
boolean
remove(Object o)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
boolean
removeAll(Collection c)
Removes from this Vector all of its elements that are contained in the specified Collection.
void
removeAllElements()
Removes all components from this vector and sets its size to zero.
boolean
removeElement(Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this vector.
void
removeElementAt(int index)
Deletes the component at the specified index.
protected void
removeRange(int fromIndex, int toIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
boolean
retainAll(Collection c)
Retains only the elements in this Vector that are contained in the specified Collection.
E
set(int index, E element)
Replaces the element at the specified position in this Vector with the specified element.
void
setElementAt(E obj, int index)
Sets the component at the specified index of this vector to be the specified object.
void
setSize(int newSize)
Sets the size of this vector.
int
size()
Returns the number of components in this vector.
List
subList(int fromIndex, int toIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
Object[]
toArray()
Returns an array containing all of the elements in this Vector in the correct order.
String
toString()
Returns a string representation of this Vector, containing the String representation of each element.
void
trimToSize()
Trims the capacity of this vector to be the vector's current size.

Methods inherited from class java.util.AbstractList<E>

add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList

Methods inherited from class java.util.AbstractCollection<E>

T[] toArray, add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

capacityIncrement

protected int capacityIncrement
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity. If the capacity increment is less than or equal to zero, the capacity of the vector is doubled each time it needs to grow.

elementCount

protected int elementCount
The number of valid components in this Vector object. Components elementData[0] through elementData[elementCount-1] are the actual items.

elementData

protected Object[] elementData
The array buffer into which the components of the vector are stored. The capacity of the vector is the length of this array buffer, and is at least large enough to contain all the vector's elements.

Any array elements following the last element in the Vector are null.

Constructor Details

Vector

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

View More Examples of Vector()
   1:     } else {
   2:         base = (new Vector()).elements();
   3:     }
   4:     }

View Full Code Here
   1:     public void setUp() {
   2:         v = new Vector();
   3:         v.addElement("one");
   4:         ...
   5:     public void testEmptyTable() {
   6:         see0 = new SortedIteratorIterator((new Vector()).iterator());
   7: 
   8:         assertTrue(!see0.hasNext());
   9:         try {

View Full Code Here
   1:         String taglibLocation;  
   2:         Enumeration taglibConfig = (new Vector()).elements();
   3:         if (descriptor.getJspConfigDescriptor() != null) {
   4:             taglibConfig = descriptor.getJspConfigDescriptor().getTagLibs();
   5:         }

View Full Code Here
   1:     {
   2:     return getChunks(getDOMNode().getChildNodes(), new Vector()).size();
   3:     }
   4:         ...
   5:     {
   6:     Node node = (Node)getChunks(getDOMNode().getChildNodes(), new Vector())
   7:         .elementAt(index);
   8:         ...
   9:     {
  10:     Node node = (Node)getChunks(getDOMNode().getChildNodes(), new Vector())
  11:         .elementAt(index);

View Full Code Here
   1:         String taglibUri;
   2:         Enumeration taglibConfig = (new Vector()).elements();
   3:         if (descriptor.getJspConfigDescriptor() != null) {
   4:             taglibConfig = descriptor.getJspConfigDescriptor().getTagLibs();
   5:         }

View Full Code Here

Vector

public Vector(E> 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.
Throws:
NullPointerException - if the specified collection is null.
Since:
1.2
Usages and Demos :

View More Examples of Vector(E> c)
   1: 
   2:         Vector v = new Vector(((AbstractAnnotation) tthis).getParentListeners());
   3: 
   4:         for (Enumeration e = v.elements(); e.hasMoreElements();) {
   5:             Object o = e.nextElement();

View Full Code Here
   1:             {
   2:                 property = new Vector((List) property);
   3:             }
   4: 
   5:             props.setProperty(key, property);

View Full Code Here
   1: 
   2:       java.util.Vector panels = new java.util.Vector( ((CustomGUIModule)module).getInputPanels() );
   3:       cbInputPanels = new JComboBox( panels );
   4:       cbInputPanels.setEnabled(true);
   5:       cbInputPanels.setBackground(Color.white);

View Full Code Here
   1:                 {
   2:                     value = new Vector((Collection) value);
   3:                 }
   4:                 props.setProperty((String) entry.getKey(), value);
   5:             }

View Full Code Here
   1:     
   2:     Vector v = new Vector((Vector)msg.getContent());
   3:     
   4:     setAcceptedProposer((AgentIdentifier)v.get(0));
   5:     

View Full Code Here

Vector

public Vector(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.
Throws:
IllegalArgumentException - if the specified initial capacity is negative
Usages and Demos :

View More Examples of Vector(int initialCapacity)
   1: 
   2:         Vector v = new Vector(((AbstractAnnotation) tthis).getParentListeners());
   3: 
   4:         for (Enumeration e = v.elements(); e.hasMoreElements();) {
   5:             Object o = e.nextElement();

View Full Code Here
   1:             {
   2:                 property = new Vector((List) property);
   3:             }
   4: 
   5:             props.setProperty(key, property);

View Full Code Here
   1: 
   2:       java.util.Vector panels = new java.util.Vector( ((CustomGUIModule)module).getInputPanels() );
   3:       cbInputPanels = new JComboBox( panels );
   4:       cbInputPanels.setEnabled(true);
   5:       cbInputPanels.setBackground(Color.white);

View Full Code Here
   1:                 {
   2:                     value = new Vector((Collection) value);
   3:                 }
   4:                 props.setProperty((String) entry.getKey(), value);
   5:             }

View Full Code Here
   1:     
   2:     Vector v = new Vector((Vector)msg.getContent());
   3:     
   4:     setAcceptedProposer((AgentIdentifier)v.get(0));
   5:     

View Full Code Here

Vector

public Vector(int initialCapacity,
              int capacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment.
Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows.
Throws:
IllegalArgumentException - if the specified initial capacity is negative
Usages and Demos :

View More Examples of Vector(int initialCapacity,int capacityIncrement)
   1:   public static Vector parse(Lecteur lin) {
   2:     Vector r= new Vector(0, 1);
   3:     String t= lin.get();
   4:     if (t.equals("etiquettes"))
   5:       t= lin.get();

View Full Code Here
   1:         if ( this.trans == null ) {
   2:             trans = new Vector( 0, 1 );
   3:         }
   4:         trans.add( tran );
   5:     }

View Full Code Here
   1:     public XSPKIData ( byte[] exp ) {
   2:         this.contents = new Vector( 1, 1 );
   3:         this.contents.add( exp );
   4:         ...
   5:         if ( this.contents == null ) {
   6:             this.contents = new Vector( 1, 1 );
   7:         }
   8:         ...
   9:         if ( this.contents == null ) {
  10:                         this.contents = new Vector( 1, 1 );
  11:         }

View Full Code Here
   1:   public static Vector parse(Lecteur lin) {
   2:     Vector r= new Vector(0, 1);
   3:     String t= lin.get();
   4:         ...
   5:   public static Vector parseXY(Lecteur lin) {
   6:     Vector r= new Vector(20, 1);
   7:     String t= lin.get();
   8:     while (!t.equals("")) {
   9:       Valeur e= new Valeur();

View Full Code Here
   1: class ApplyIT {
   2:    Vector type_list = new Vector(1,1);
   3:         ...
   4:    Vector ist_list = new Vector(1,1);
   5: 
   6:         ...
   7:    ApplyIT() {
   8:       type_list = new Vector(1,1);
   9:       ist_list = new Vector(1,1);

View Full Code Here

Method Details

T[] toArray

public  T[] toArray(T[] a)
Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array. If the Vector fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this Vector.

If the Vector fits in the specified array with room to spare (i.e., the array has more elements than the Vector), the element in the array immediately following the end of the Vector is set to null. This is useful in determining the length of the Vector only if the caller knows that the Vector does not contain any null elements.

Specified by:
T[] toArray in interface List<E>
T[] toArray in interface Collection<E>
Overrides:
T[] toArray in interface AbstractCollection<E>
Parameters:
a - the array into which the elements of the Vector are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the Vector.
Throws:
ArrayStoreException - the runtime type of a is not a supertype of the runtime type of every element in this Vector.
NullPointerException - if the given array is null.
Since:
1.2

add

public boolean add(E o)
Appends the specified element to the end of this Vector.
Specified by:
add in interface List<E>
add in interface Collection<E>
Overrides:
add in interface AbstractList<E>
Parameters:
o - element to be appended to this Vector.
Returns:
true (as per the general contract of Collection.add).
Since:
1.2
Usages and Demos :

View More Examples of add(E o)
   1: {
   2:   private Vector to = new Vector();
   3: 
   4:         ...
   5:       {
   6:         regexps.add(tokens[0]);
   7:         if (tokens.length > 1)
   8:         ...
   9:           to.add(tokens[1]);
  10:         else
  11:         ...
  12:           to.add("");

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: {
   6:     public static Vector Base64Tokens = new Vector(64);
   7:     static
   8:         ...
   9:     {
  10:         Base64Tokens.add("A");
  11:         ...
  12:         Base64Tokens.add("B");

View Full Code Here
   1: import java.io.RandomAccessFile;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     {
   6:         Vector t_cargs = new Vector();
   7:         ...
   8:         t_cargs.add("-sourcepath");
   9:         ...
  10:         t_cargs.add(generator.sourcePath);

View Full Code Here
   1: import pk.edu.niit.clarens.services.softwareDiscovery.SoftwarePackage;
   2: import java.util.Vector;
   3: import java.util.Date;
   4:         ...
   5: 
   6:         Vector paramNames = new Vector();
   7:         Vector paramValueTypes = new Vector();
   8:         ...
   9:         Vector paramValues = new Vector();
  10:         paramNames.add("");
  11:         ...
  12:         paramNames.add("expire.");

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: import javax.swing.tree.DefaultMutableTreeNode;
   4:         ...
   5:         Hashtable dm = new Hashtable();
   6:         Vector f = null;
   7: 
   8:         ...
   9:         {
  10:           f = new Vector();
  11:         ...
  12:           f.add(InventoryMetric.REQUESTED_DUE_OUT.toString());

View Full Code Here

add

public void add(int index,
                E element)
Inserts the specified element at the specified position in this Vector. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Specified by:
add in interface List<E>
Overrides:
add in interface AbstractList<E>
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
ArrayIndexOutOfBoundsException - index is out of range (index < 0 || index > size()).
Since:
1.2
Usages and Demos :

View More Examples of add(int index,E element)
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     System.out.println("doubleMax = " + doubleMax);
   6:     Vector v = new Vector();
   7:         ...
   8:     v.add(0, "AspectJ");
   9:     Object str = v.get(0);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5:     private boolean suspended;
   6:     protected Vector consumers;
   7:     protected String name;
   8:         ...
   9:       suspended = false;
  10:       consumers = new Vector();
  11:     }
  12:         ...
  13:     } else {
  14:         consumers.add(0, consumer);

View Full Code Here
   1: import java.util.Set;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:    public Vector getDataSetKeys(Class type, Component owner)
   7:    {
   8:         ...
   9:       Iterator it = allKeys.iterator();
  10:       Vector matchingKeys = new Vector();
  11: 
  12:         ...
  13:          {
  14:             matchingKeys.add(0, currentKey);

View Full Code Here
   1: import java.io.Serializable;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     public Vector addComments(Node node, Vector result) {
   7:         for (Node prev = node.getPreviousSibling();
   8:         ...
   9:                     result = new Vector();
  10:                 result.add(0,comment);
  11:             } else

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5:     
   6:     Vector chain = new Vector();
   7:     Object chainWalk = child;
   8:         ...
   9:     while ( chainWalk != null ) {
  10:       chain.add(0, chainWalk);
  11:       chainWalk = ((UnitTreeModel)unitTreeModel).getParent((Node) chainWalk);

View Full Code Here

addAll

public boolean addAll(E> c)
Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this Vector, and this Vector is nonempty.)
Specified by:
addAll in interface List<E>
addAll in interface Collection<E>
Overrides:
addAll in interface AbstractCollection<E>
Parameters:
c - elements to be inserted into this Vector.
Returns:
true if this Vector changed as a result of the call.
Throws:
NullPointerException - if the specified collection is null.
Since:
1.2
Usages and Demos :

View More Examples of addAll(E> c)
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: {
   6:     private Vector elements;
   7: 
   8:         ...
   9:         super();
  10:         elements = new Vector();
  11:     }
  12:         ...
  13:     {
  14:         elements.addAll(((ArticleCollection) otherCollection).elements);

View Full Code Here
   1:   }
   2:   public Vector getEnfants() {
   3:     return getTousEnfants();
   4:         ...
   5:   }
   6:   public Vector getTousEnfants() {
   7:         ...
   8:     Vector v= new Vector();
   9:     Enumeration enfants= getAllChildren();
  10:         ...
  11:       else if (element instanceof BGroupeLumiere)
  12:         v.addAll(((BGroupeLumiere)element).getTousEnfants());

View Full Code Here
   1: import java.util.Map;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         Object value;
   6:         Vector current;
   7:         Map.Entry entry;
   8:         ...
   9:             value = entry.getValue();
  10:             current = (Vector) headers.get(key);
  11:             if (value instanceof Vector)
  12:         ...
  13:                 {
  14:                     current.addAll((Vector) value);

View Full Code Here
   1: 
   2:     public static Vector toVector(Object obj)
   3:     {
   4:         ...
   5: 
   6:     public static Vector toVector(Object obj, Vector result)
   7:     {
   8:         ...
   9:         if (obj instanceof Collection)
  10:             result.addAll((Collection)obj);
  11:         else if (isIteratable(obj)) {

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     boolean failed=false;
   6:     Vector fileVec=new Vector();
   7:     Vector execs=new Vector();
   8:         ...
   9:             if(!((Job)b).fileVec.isEmpty()){
  10:                 fileVec.addAll(((Job)b).fileVec);
  11:                 

View Full Code Here

addAll

public boolean addAll(int index,
                      E> c)
Inserts all of the elements in the specified Collection into this Vector at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the Vector in the order that they are returned by the specified Collection's iterator.
Specified by:
addAll in interface List<E>
Overrides:
addAll in interface AbstractList<E>
Parameters:
index - index at which to insert first element from the specified collection.
c - elements to be inserted into this Vector.
Returns:
true if this Vector changed as a result of the call.
Throws:
ArrayIndexOutOfBoundsException - index out of range (index < 0 || index > size()).
NullPointerException - if the specified collection is null.
Since:
1.2
Usages and Demos :

View More Examples of addAll(int index,E> c)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:   return list.addAll(index, c);
   7:  }
   8: 
   9: public void clear()

View Full Code Here
   1: public class ListWrapper implements List {
   2:     private Vector myDelegee;
   3: 
   4:         ...
   5:     public ListWrapper() {
   6:         myDelegee = new Vector();
   7:     }
   8:         ...
   9:     public ListWrapper(int initialSize) {
  10:         myDelegee = new Vector(initialSize);
  11:     }
  12:         ...
  13:     public boolean addAll(int index, Collection c) {
  14:         return myDelegee.addAll(index, c);

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: import javax.swing.tree.DefaultMutableTreeNode;
   4:         ...
   5: {
   6:     public static Vector getSubordinateList(TreeNode tn, boolean justLeaves)
   7:     {
   8:         ...
   9:         Vector nodeList = new Vector();
  10: 
  11:         ...
  12:                 TreeNode node = (TreeNode)children.nextElement();
  13:                 nodeList.addAll(getSubordinateList(node, justLeaves));

View Full Code Here
   1: import java.util.Set;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector vector;
   7: 
   8:         ...
   9:     public boolean addAll(int arg0, Collection arg1) {
  10:         return vector.addAll(arg0, arg1);
  11:     }

View Full Code Here
   1: import java.util.NoSuchElementException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: {
   6:     private Vector mirror = new Vector();
   7:     private Object eventSource = null;
   8:         ...
   9:     {
  10:         mirror.addAll(index0, newValues);
  11:         for (int i = 0; i < newValues.size(); i++)

View Full Code Here

addElement

public void addElement(E obj)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.

This method is identical in functionality to the add(Object) method (which is part of the List interface).

Parameters:
obj - the component to be added.
See Also:
add(Object), List
Usages and Demos :

View More Examples of addElement(E obj)
   1: public class EditTool extends ObjectConstructor
   2: {    Vector V;
   3:     
   4:         ...
   5:         else 
   6:         {    V=new Vector(); V.addElement(o);
   7:         }
   8:         ...
   9:         if (o.isKeep()) return;
  10:         if (V==null) V=new Vector();
  11:         if (!V.contains(o))
  12:         ...
  13:         {    V.addElement(o);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import javax.swing.table.*;
   4:         ...
   5:     private class VectorColumn {
   6:     Vector names=new Vector();
   7:     
   8:         ...
   9:         while (row>=names.size())
  10:         names.addElement("");
  11:         names.setElementAt(obj,row);
  12:         ...
  13:     void  addValue(String val) {
  14:         names.addElement(val);

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     
   6:     public EditConditionals (Frame f, ConstructionObject o, Vector v)
   7:     {    super(f,
   8:         ...
   9:         if (v==null)
  10:         {    V=new Vector(); V.addElement(o);
  11:         }
  12:         ...
  13:     
  14:     public EditConditionals (Frame f, Vector v)

View Full Code Here
   1: import java.io.File;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     protected final String MATCHER_PACKAGE = "matcherpackage";
   6:     protected Vector packages;
   7: 
   8:         ...
   9:         throws ConfigurationException {
  10:         packages = new Vector();
  11:         ...
  12:         packages.addElement("");

View Full Code Here
   1:     int i, n = attrList.size();
   2:     Vector scopes = new Vector();
   3: 
   4:         ...
   5:         if (id.equals(SCOPE_ATTR_ID)) {
   6:         Vector vals = attr.getValues();
   7:         int j, m = vals.size();
   8:         ...
   9: 
  10:             scopes.addElement(scope);
  11:         }
  12:         ...
  13:         if (!SLPConfig.getSLPConfig().getAcceptSLPv1UnscopedRegs()) {
  14:         scopes.addElement("");

View Full Code Here

capacity

public int capacity()
Returns the current capacity of this vector.
Returns:
the current capacity (the length of its internal data array, kept in the field elementData of this vector).
Usages and Demos :

View More Examples of capacity()
   1: 
   2: import java.util.Vector;
   3: import java.util.Enumeration;
   4:         ...
   5: public final class StringVector {
   6:     Vector vector;
   7:     
   8:         ...
   9:     public final int capacity() {
  10:         return vector.capacity();
  11:     }

View Full Code Here
   1:     private static final int TABLE_SIZE = 19;
   2:     private Vector fakeTable;
   3:     private Hashtable table;
   4:         ...
   5:         table = new Hashtable();
   6:         fakeTable = new Vector(TABLE_SIZE);
   7:         ...
   8:         for (int walk=0; walk<fakeTable.capacity(); walk++) {
   9:         ...
  10:             fakeTable.addElement(new Vector(0,1));

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized int capacity() {
  11:         return v.capacity();

View Full Code Here
   1: import jp.ujihara.java.util.Enumeration;
   2: import jp.ujihara.java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   private Vector elements = new Vector();
   7: 
   8:         ...
   9:   {
  10:     return elements.capacity();
  11:   }

View Full Code Here

clear

public void clear()
Removes all of the elements from this Vector. The Vector will be empty after this call returns (unless it throws an exception).
Specified by:
clear in interface List<E>
clear in interface Collection<E>
Overrides:
clear in interface AbstractList<E>
Since:
1.2
Usages and Demos :

View More Examples of clear()
   1:     BookInfo bInfo = new BookInfo();
   2:     Vector books=new Vector();
   3: 
   4:         ...
   5:     public void setBooks( Book[] bArr ) {
   6:     books = new Vector( bArr.length, 10 );
   7:     for( int i=0;i<bArr.length;i++ ) books.add( bArr[i] );
   8:         ...
   9:     public void clear() {
  10:     books.clear();
  11:     }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class DocumentSelectionManager {
   6:     private Vector selections;
   7: 
   8:         ...
   9:     public DocumentSelectionManager() {
  10:         selections = new Vector();
  11:     }
  12:         ...
  13:     public void clear() {
  14:         selections.clear();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     try {
   6:       Vector params = new Vector();
   7:         ...
   8:       params.clear();
   9:       Object result = test.execute("generator.version", params);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.clear();

View Full Code Here
   1:   public final static FudaaParamChangeLog CHANGE_LOG= new FudaaParamChangeLog();
   2:   private Vector changeLog_;
   3:   private BuApplication app_;
   4:         ...
   5:   protected FudaaParamChangeLog() {
   6:     changeLog_= new Vector();
   7:     app_= null;
   8:         ...
   9:   private void cleanChangeLog() {
  10:     changeLog_.clear();
  11:     setDirty(false);

View Full Code Here

clone

public Object clone()
Returns a clone of this vector. The copy will contain a reference to a clone of the internal data array, not a reference to the original internal data array of this Vector object.
Overrides:
clone in interface Object
Returns:
a clone of this vector.
Usages and Demos :

View More Examples of clone()
   1: 
   2:   private transient Vector actionListeners;
   3: 
   4:         ...
   5:     if (actionListeners != null && actionListeners.contains(l)) {
   6:       Vector v = (Vector) actionListeners.clone();
   7:       v.removeElement(l);
   8:         ...
   9:   public synchronized void addActionListener(ActionListener l) {
  10:     Vector v = actionListeners == null ? new Vector(2) : (Vector) actionListeners.clone();
  11:     if (!v.contains(l)) {

View Full Code Here
   1:   private int department = Dept.UNASSIGNED;
   2:   private Vector hireListeners = new Vector();
   3:   private PropertyChangeSupport changes =
   4:         ...
   5:   protected void notifyHired() {
   6:     Vector l;
   7:     HireEvent h = new HireEvent(this);
   8:         ...
   9:     synchronized(this) {
  10:       l = (Vector)hireListeners.clone();
  11:     }

View Full Code Here
   1:   private PrintStream out = null;
   2:   private Vector targets = new Vector();
   3: 
   4:         ...
   5:   protected void notifyTargetsSent(String s) {
   6:     Vector l;
   7:     SocketEvent se = new SocketEvent(this, s);
   8:         ...
   9:     synchronized(this) {
  10:       l = (Vector) targets.clone();
  11:     }
  12:         ...
  13:     synchronized(this) {
  14:       l = (Vector) targets.clone();

View Full Code Here
   1: import java.net.URL;
   2: import jp.ujihara.java.util.Vector;
   3: 
   4:         ...
   5: {
   6:   Vector consumers = new Vector ();
   7:   String filename;
   8:         ...
   9: 
  10:     Vector list = (Vector) consumers.clone();
  11:     try 

View Full Code Here
   1:   private Color featuresColor = Color.black;
   2:   private Vector smileyListeners = new Vector();
   3:   private PropertyChangeSupport changes =
   4:         ...
   5:   protected void notifyTargets() {
   6:     Vector l;
   7:     SmileyEvent s = new SmileyEvent(this);
   8:         ...
   9:     synchronized(this) {
  10:       l = (Vector) smileyListeners.clone();
  11:     }

View Full Code Here

contains

public boolean contains(Object elem)
Tests if the specified object is a component in this vector.
Specified by:
contains in interface List<E>
contains in interface Collection<E>
Overrides:
contains in interface AbstractCollection<E>
Parameters:
elem - an object.
Returns:
true if and only if the specified object is the same as a component in this vector, as determined by the equals method; false otherwise.
Usages and Demos :

View More Examples of contains(Object elem)
   1: import java.util.Vector;
   2: public class FindVector {
   3:         ...
   4:   public static void main (String args[]) {
   5:     Vector v = new Vector();
   6:     for (int i=0, n=members.length; i<n; i++) {
   7:         ...
   8:     System.out.println("Contains Society?: " + 
   9:       v.contains("Society"));
  10:     System.out.println("Contains Waldo?: " + 
  11:         ...
  12:       v.contains("Waldo"));

View Full Code Here
   1:            ServiceURL url,
   2:            Vector scopes,
   3:         ...
   4:            Vector attrs)
   5:     throws ServiceLocationException {
   6:         ...
   7:             ServiceURL url,
   8:             Vector scopes,
   9:             Vector attrs)
  10:         ...
  11:         scopes.size() <= 1 &&
  12:         scopes.contains(Defaults.DEFAULT_SCOPE)) {

View Full Code Here
   1: import org.apache.jetspeed.om.registry.CapabilityMap;
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     private Vector caps = new Vector();
   7: 
   8:         ...
   9:     {
  10:         if (!caps.contains(name))
  11:         {
  12:         ...
  13:     {
  14:         return caps.contains(capability);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Hashtable;
   4:         ...
   5: {
   6:     private Vector capabilities = null;
   7:     private ClientEntry clientEntry = null;
   8:         ...
   9:         if (capabilities==null) return false;
  10:         return capabilities.contains(capability);
  11:     }
  12:         ...
  13:         for (int i=0; i<capabilities.length; i++)
  14:             if (!this.capabilities.contains(capabilities[i])) return false;

View Full Code Here
   1: import java.util.Collection;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     public Collection getDerbyDatabases(String derbySysHome) {
   6:         Vector databases = new Vector();
   7:         File f = new File(derbySysHome);
   8:         ...
   9:         Collection databases = getDerbyDatabases(derbySysHome);
  10:         return databases.contains(dbName);
  11:     }

View Full Code Here

containsAll

public boolean containsAll(Collection c)
Returns true if this Vector contains all of the elements in the specified Collection.
Specified by:
containsAll in interface List<E>
containsAll in interface Collection<E>
Overrides:
containsAll in interface AbstractCollection<E>
Parameters:
c - a collection whose elements will be tested for containment in this Vector
Returns:
true if this Vector contains all of the elements in the specified collection.
Throws:
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of containsAll(Collection c)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.containsAll(c);
   7:  }
   8: 
   9: public boolean equals(Object o)

View Full Code Here
   1: public class ListWrapper implements List {
   2:     private Vector myDelegee;
   3: 
   4:         ...
   5:     public ListWrapper() {
   6:         myDelegee = new Vector();
   7:     }
   8:         ...
   9:     public ListWrapper(int initialSize) {
  10:         myDelegee = new Vector(initialSize);
  11:     }
  12:         ...
  13:     public boolean containsAll(Collection c) {
  14:         return myDelegee.containsAll(c);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleSetImpl implements SecurityRoleSet {
   6:     private Vector roles = new Vector();
   7:     public SecurityRole get(String name) {
   8:         ...
   9:     public boolean containsAll(Collection arg0) {
  10:         return roles.containsAll(arg0);
  11:     }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleRefSetImpl implements SecurityRoleRefSet {
   6:     private Vector container = new Vector();
   7:     
   8:         ...
   9:     public boolean containsAll(Collection arg0) {
  10:         return container.containsAll(arg0);
  11:     }

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized boolean containsAll(Collection c) {
  11:         return v.containsAll(c);

View Full Code Here

copyInto

public void copyInto(Object[] anArray)
Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown.
Parameters:
anArray - the array into which the components get copied.
Throws:
NullPointerException - if the given array is null.
Usages and Demos :

View More Examples of copyInto(Object[] anArray)
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     private StringBuffer buffer;
   6:     private Vector comments;
   7:     public CommentTemplatesContentHandler() {
   8:         ...
   9:         if (elementName.equals(RepositoryManager.ELEMENT_COMMENT_TEMPLATES)) {
  10:             comments = new Vector();
  11:             return;
  12:         ...
  13:             RepositoryManager.commentTemplates = new String[comments.size()];
  14:             comments.copyInto(RepositoryManager.commentTemplates);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     private StringBuffer buffer;
   6:     private Vector comments;
   7:     public CommentHistoryContentHandler() {
   8:         ...
   9:         if (elementName.equals(RepositoryManager.ELEMENT_COMMIT_HISTORY)) {
  10:             comments = new Vector(RepositoryManager.DEFAULT_MAX_COMMENTS);
  11:             return;
  12:         ...
  13:             RepositoryManager.previousComments = new String[comments.size()];
  14:             comments.copyInto(RepositoryManager.previousComments);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private Vector pin_info = new Vector();
   7: 
   8:         ...
   9:         PINInfo = new PINData[pin_info.size()];
  10:         pin_info.copyInto(PINInfo);
  11:     }

View Full Code Here
   1:         parseValue( use );
   2:         Vector v = (Vector)properties.get( "APPLIES" );
   3:         if ( v != null ) {
   4:         ...
   5:             _attributes = new String[v.size()];
   6:             v.copyInto( _attributes );
   7:             v.removeAllElements();
   8:         }
   9:     }

View Full Code Here
   1:         }
   2:         Vector v = (Vector)properties.get( "APPLIES" );
   3:         if ( v != null ) {
   4:         ...
   5:             _attributes = new String[v.size()];
   6:             v.copyInto( _attributes );
   7:             v.removeAllElements();
   8:         }
   9:         String val = (String)properties.get( "SYNTAX" );

View Full Code Here

elementAt

public E elementAt(int index)
Returns the component at the specified index.

This method is identical in functionality to the get method (which is part of the List interface).

Parameters:
index - an index into this vector.
Returns:
the component at the specified index.
Throws:
ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this Vector object. given.
See Also:
get(int), List
Usages and Demos :

View More Examples of elementAt(int index)
   1: import java.util.Vector;
   2: import java.lang.reflect.*;
   3:         ...
   4: {
   5:     static Vector v = new Vector();
   6: 
   7:         ...
   8: 
   9:     Class cc = v.elementAt(0).getClass();
  10:     final Object ni = cc.newInstance();
  11:         ...
  12:             System.out.println("t2 " + 
  13:             v.elementAt(0).getClass().newInstance());

View Full Code Here
   1: import java.util.Vector;
   2: import java.lang.reflect.*;
   3:         ...
   4: {
   5:     static Vector v = new Vector();
   6: 
   7:         ...
   8: 
   9:     Class cc = v.elementAt(0).getClass();
  10:     final Object ni = cc.newInstance();
  11:         ...
  12:             System.out.println("t2 " + 
  13:             v.elementAt(0).getClass().newInstance());

View Full Code Here
   1: import java.awt.*;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:   public Class getColumnClass(int col) {
   6:     Vector v = (Vector)dataVector.elementAt(0);
   7:         ...
   8:     return v.elementAt(col).getClass();
   9:   }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import marquee.xmlrpc.XmlRpcException;
   4:         ...
   5:         String methodName,
   6:         Vector arguments ) throws Throwable
   7:     {
   8:         ...
   9:                                                 CallWrapper.class,
  10:                                                 arguments.elementAt( 0 ) );

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class Queue {
   6:     private Vector vector = new Vector();
   7: 
   8:         ...
   9:         return null;
  10:     return vector.elementAt(0);
  11:     }

View Full Code Here

elements

public Enumeration elements()
Returns an enumeration of the components of this vector. The returned Enumeration object will generate all items in this vector. The first item generated is the item at index 0, then the item at index 1, and so on.
Returns:
an enumeration of the components of this vector.
Usages and Demos :

View More Examples of elements()
   1: {
   2:   private Vector values_;
   3: 
   4:         ...
   5:   public YapodStaticVectorQuery(Vector _values)
   6:   {
   7:         ...
   8:   public final Enumeration getResult()
   9:     { return values_.elements(); }

View Full Code Here
   1: 
   2:     Vector r=new Vector(1);
   3:     r.addElement(new Integer(n));
   4:         ...
   5:     return r.elements();
   6:   }
   7: 
   8:   public String toString()

View Full Code Here
   1: 
   2:     Vector r=new Vector(1);
   3:     r.addElement(new Double(sum));
   4:         ...
   5:     return r.elements();
   6:   }
   7: 
   8:   public String toString()

View Full Code Here
   1: 
   2:     Vector r=new Vector(1);
   3:     if(o!=FAKE) r.addElement(o);
   4:         ...
   5:     return r.elements();
   6:   }
   7: 
   8:   public String toString()

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Enumeration;
   4:         ...
   5:     {
   6:         return componentVector.elements();
   7:     }
   8:         ...
   9: 
  10:     private Vector componentVector = new java.util.Vector();
  11: }

View Full Code Here

ensureCapacity

public void ensureCapacity(int minCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.

If the current capacity of this vector is less than minCapacity, then its capacity is increased by replacing its internal data array, kept in the field elementData, with a larger one. The size of the new data array will be the old size plus capacityIncrement, unless the value of capacityIncrement is less than or equal to zero, in which case the new capacity will be twice the old capacity; but if this new size is still smaller than minCapacity, then the new capacity will be minCapacity.

Parameters:
minCapacity - the desired minimum capacity.
Usages and Demos :

View More Examples of ensureCapacity(int minCapacity)
   1:     BookInfo bInfo = new BookInfo();
   2:     Vector books=new Vector();
   3: 
   4:         ...
   5:     public void setBooks( Book[] bArr ) {
   6:     books = new Vector( bArr.length, 10 );
   7:     for( int i=0;i<bArr.length;i++ ) books.add( bArr[i] );
   8:         ...
   9:     public void ensureCapacity( int cap ) {
  10:     books.ensureCapacity( cap );
  11:     }

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.ensureCapacity(minCapacity);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.ensureCapacity(minCapacity);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.ensureCapacity(minCapacity);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.ensureCapacity(minCapacity);

View Full Code Here

equals

public boolean equals(Object o)
Compares the specified Object with this Vector for equality. Returns true if and only if the specified Object is also a List, both Lists have the same size, and all corresponding pairs of elements in the two Lists are equal. (Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)).) In other words, two Lists are defined to be equal if they contain the same elements in the same order.
Specified by:
equals in interface List<E>
equals in interface Collection<E>
Overrides:
equals in interface AbstractList<E>
Parameters:
o - the Object to be compared for equality with this Vector.
Returns:
true if the specified Object is equal to this Vector
Usages and Demos :

View More Examples of equals(Object o)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.equals(o);
   7:  }
   8: 
   9: public Object get(int index)

View Full Code Here
   1: import java.util.Arrays;
   2: import java.util.Vector;
   3: import java.util.List;
   4:         ...
   5:         UDDI_REGISTRIES.getValue();
   6:     listUDDI.setModel(new Vector(Arrays.asList(arrayUDDIReg)));
   7:   }
   8:         ...
   9:   {
  10:     Vector model = listUDDI.getModel();
  11:     String[] arrayUDDIReg = new String[model.size()];
  12:         ...
  13:     List model = Arrays.asList(LionShareApplicationSettings.UDDI_REGISTRIES.getValue());
  14:     return !model.equals(listUDDI.getModel());

View Full Code Here
   1: import java.util.List;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         String[] bannedWords = FilterSettings.BANNED_WORDS.getValue();
   6:         RESULTS_LIST.setModel(new Vector<String>(Arrays.asList(bannedWords)));
   7:     }
   8:         ...
   9:     public boolean applyOptions() throws IOException {
  10:         Vector model = RESULTS_LIST.getModel();
  11:         String[] bannedResults = new String[model.size()];
  12:         ...
  13:       List model = Arrays.asList(FilterSettings.BANNED_WORDS.getValue());
  14:       return !model.equals(RESULTS_LIST.getModel());

View Full Code Here
   1: import java.util.Stack;
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     private Vector v = null;
   7: 
   8:         ...
   9:         }
  10:         v = (v == null) ? new Vector() : v;
  11:         v.add(c);
  12:         ...
  13:         if (isReference()) {
  14:             return getCheckedRef().equals(o);

View Full Code Here
   1: import java.util.NoSuchElementException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     public static boolean equals(Vector v1, Vector v2) {
   7:         if (v1 == v2) {
   8:         ...
   9: 
  10:         return v1.equals(v2);
  11:     }
  12:         ...
  13:             Object value2 = d2.get(key);
  14:             if (value2 == null || !value1.equals(value2)) {

View Full Code Here

firstElement

public E firstElement()
Returns the first component (the item at index 0) of this vector.
Returns:
the first component of this vector.
Throws:
NoSuchElementException - if this vector has no components.
Usages and Demos :

View More Examples of firstElement()
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     {
   6:     ListBundNames = new Vector();
   7:     }
   8:         ...
   9:     {
  10:     return ListBundNames.firstElement();
  11:     }
  12:         ...
  13: 
  14:     private Vector ListBundNames;

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: import java.util.Hashtable;
   4:         ...
   5:     protected  Hashtable Dependance = new Hashtable();
   6:     protected Vector listMsgs = new Vector();
   7:     protected Double ch=new Double(0.01);
   8:         ...
   9:     while (listMsgs.size()!=0) {
  10:            if (listMsgs.firstElement() instanceof SendMessageEvent) {
  11:         ...
  12:         SendMessageEvent mesEv= (SendMessageEvent) listMsgs.firstElement();

View Full Code Here
   1: import java.util.Properties;
   2: import java.util.Vector;
   3: import java.util.Hashtable;
   4:         ...
   5: 
   6:     Vector laststeps = PersonalHistoryPlugin.getHistory(e).getSteps(1);
   7:     if (laststeps.size() > 0) {
   8:         ...
   9:       Step mostRecent = (Step) laststeps.firstElement();
  10:       String backlink = HtmlHelper.urlToLink(mostRecent.getDocumentVersion().getDocumentUrl().getUrl(),

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized Object firstElement() {
  11:         return v.firstElement();

View Full Code Here
   1: 
   2:   private Vector _v;
   3: 
   4:         ...
   5:   
   6:   public Set() { _v = new Vector(); }
   7:         ...
   8:   public Set(int n) { _v = new Vector(n); }
   9:   public Set(Object o1) { _v = new Vector(); addElement(o1); }
  10:         ...
  11: 
  12:   public Object firstElement() { return _v.firstElement(); }

View Full Code Here

get

public E get(int index)
Returns the element at the specified position in this Vector.
Specified by:
get in interface List<E>
Overrides:
get in interface AbstractList<E>
Parameters:
index - index of element to return.
Returns:
object at the specified index
Throws:
ArrayIndexOutOfBoundsException - index is out of range (index < 0 || index >= size()).
Since:
1.2
Usages and Demos :

View More Examples of get(int index)
   1: import java.io.PrintWriter;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class BanList {
   6:     private Vector ips;
   7:         ...
   8:     private Vector reason;
   9:     
  10:         ...
  11:         for (int i = 0; i < ips.size(); i++)
  12:             if ((ips.get(i)).equals(IP)) {

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     protected void doIt(Vector selected) {
   7:         if (selected != null && selected.size() >= 1) {
   8:         ...
   9:             Model.getCommonBehaviorHelper().setInstantiation(getTarget(),
  10:                     selected.get(0));
  11:         } else {
  12:         ...
  13: 
  14:     protected Vector getChoices() {

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector _calls;
   7: 
   8:         ...
   9:     public SimpleListener () {
  10:         _calls = new Vector();
  11:     }
  12:         ...
  13:                 "<call number=\"" + (i+1) + "\">" +
  14:                 _calls.get(i).toString() + "</call>");

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     protected void doIt(Vector selected) {
   7:         if (selected != null && selected.size() >= 1) {
   8:         ...
   9:                     getTarget(),
  10:                     selected.get(0));
  11:         } else {
  12:         ...
  13: 
  14:     protected Vector getChoices() {

View Full Code Here
   1: import java.io.UnsupportedEncodingException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     Vector m_content;
   7: 
   8:         ...
   9:     Vector m_dependencies;
  10: 
  11:         ...
  12:     public Object get(int i) {
  13:         return m_content.get(i);

View Full Code Here

hashCode

public int hashCode()
Returns the hash code value for this Vector.
Specified by:
hashCode in interface List<E>
hashCode in interface Collection<E>
Overrides:
hashCode in interface AbstractList<E>
Usages and Demos :

View More Examples of hashCode()
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.hashCode();
   7:  }
   8: 
   9: public int indexOf(Object o)

View Full Code Here
   1: import java.util.Stack;
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     private Vector v = null;
   7: 
   8:         ...
   9:         }
  10:         v = (v == null) ? new Vector() : v;
  11:         v.add(c);
  12:         ...
  13:         if (isReference()) {
  14:             return getCheckedRef().hashCode();

View Full Code Here
   1: 
   2:     private Vector fields;
   3:         ...
   4:     private Vector sortDirs;
   5: 
   6:         ...
   7:     public NodeComparator(Vector fields) {
   8:         this.fields = fields;
   9:         ...
  10:         if (obj instanceof NodeComparator) {
  11:             return (obj.hashCode()==hashCode());

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized int hashCode() {
  11:         return v.hashCode();

View Full Code Here
   1: import java.util.Hashtable;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     public void setCacheGroups(Vector groupNames) {
   7:         ...
   8:         groupNames.hashCode();
   9:     }
  10:         ...
  11: 
  12:     public void setCacheParameters(Vector parameterNames) {

View Full Code Here

indexOf

public int indexOf(Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.
Specified by:
indexOf in interface List<E>
Overrides:
indexOf in interface AbstractList<E>
Parameters:
elem - an object.
Returns:
the index of the first occurrence of the argument in this vector, that is, the smallest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found.
Usages and Demos :

View More Examples of indexOf(Object elem)
   1: import java.util.Vector;
   2: public class FindVector {
   3:         ...
   4:   public static void main (String args[]) {
   5:     Vector v = new Vector();
   6:     for (int i=0, n=members.length; i<n; i++) {
   7:         ...
   8:     System.out.println("Where's Waldo?: " + 
   9:       v.indexOf("Waldo"));
  10:     System.out.println("Where's Thoreau?: " + 
  11:         ...
  12:       v.indexOf("Thoreau"));

View Full Code Here
   1: import org.mindswap.service.Service;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class FilteredListRenderer extends JLabel implements ListCellRenderer {
   6:     Vector passFilter = null;
   7:     
   8:         ...
   9:     public FilteredListRenderer(Vector filter) {
  10:         passFilter = filter;
  11:         ...
  12:         if(value instanceof Service &&
  13:            passFilter.indexOf(((Service)value).getName())==-1)

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   private Vector children = new Vector();
   7: 
   8:         ...
   9:   public int getWidgetIndex(Widget child) {
  10:     return children.indexOf(child);
  11:   }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector flatChildren;
   7: 
   8:         ...
   9:         super(name);
  10:         flatChildren = new Vector();
  11:     }
  12:         ...
  13:         if (flat && parent == getRoot()) {
  14:             return flatChildren.indexOf(child);

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     if (parent instanceof ToDoList) {
   6:         return KnowledgeTypeNode.getTypes().indexOf(child);
   7:     }
   8:         ...
   9:     if (parent instanceof KnowledgeTypeNode) {
  10:         Vector candidates = new Vector();
  11:         KnowledgeTypeNode ktn = (KnowledgeTypeNode) parent;
  12:         ...
  13:         }
  14:         return candidates.indexOf(child);

View Full Code Here

indexOf

public int indexOf(Object elem,
                   int index)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
Parameters:
elem - an object.
index - the non-negative index to start searching from.
Returns:
the index of the first occurrence of the object argument in this vector at position index or later in the vector, that is, the smallest value k such that elem.equals(elementData[k]) && (k >= index) is true; returns -1 if the object is not found. (Returns -1 if index >= the current size of this Vector.)
Throws:
IndexOutOfBoundsException - if index is negative.
Usages and Demos :

View More Examples of indexOf(Object elem,int index)
   1: 
   2: import java.util.Vector;
   3: import java.util.Enumeration;
   4:         ...
   5: public final class StringVector {
   6:     Vector vector;
   7:     
   8:         ...
   9:     public final int indexOf(String elem, int index) {
  10:         return vector.indexOf(elem, index);
  11:     }

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized int indexOf(Object elem, int index) {
  11:         return v.indexOf(elem, index);

View Full Code Here
   1: import java.util.StringTokenizer;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         int i = -1;
   6:         while ((i = placeHolders.indexOf(ph, i + 1)) != -1) {
   7:             ph = (PlaceHolder)placeHolders.elementAt(i);
   8:         ...
   9:         BufferedReader br = new BufferedReader(new FileReader(file));
  10:         placeHolders = new Vector();
  11:         StringBuffer strBuf = new StringBuffer();

View Full Code Here
   1: import jp.ujihara.java.util.EventListener;
   2: import jp.ujihara.java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   protected Vector tableColumns;
   7: 
   8:         ...
   9:   {
  10:     tableColumns = new Vector();
  11:     setSelectionModel(new DefaultListSelectionModel());
  12:         ...
  13:   {
  14:     return tableColumns.indexOf(obj, 0);

View Full Code Here
   1: import jp.ujihara.java.util.Enumeration;
   2: import jp.ujihara.java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   private Vector elements = new Vector();
   7: 
   8:         ...
   9:   {
  10:     return elements.indexOf(element, startIndex);
  11:   }

View Full Code Here

insertElementAt

public void insertElementAt(E obj,
                            int index)
Inserts the specified object as a component in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than or equal to 0 and less than or equal to the current size of the vector. (If the index is equal to the current size of the vector, the new element is appended to the Vector.)

This method is identical in functionality to the add(Object, int) method (which is part of the List interface). Note that the add method reverses the order of the parameters, to more closely match array usage.

Parameters:
obj - the component to insert.
index - where to insert the new component.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), add(int, Object), List
Usages and Demos :

View More Examples of insertElementAt(E obj,int index)
   1: {
   2:   protected Vector fifo_=new Vector();
   3: 
   4:         ...
   5:     if("cancel".equals(_message.act()))
   6:       fifo_.insertElementAt(_message,0);
   7:     else
   8:       fifo_.addElement(_message);
   9:   }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     _historyList = new Vector();
   7:     for (int i = 0; i < 5; i++)
   8:         ...
   9:         {
  10:           _historyList.insertElementAt(_serverStr, 0);
  11:         }
  12:         ...
  13:   private int _exitOption = CANCEL_OPTION;
  14:   private Vector _historyList = null;

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.util.Vector;
   3: import javax.swing.JTable;
   4:         ...
   5: 
   6:     private Vector                     playerNames;
   7:     private DefaultTableModel          tableModel;
   8:         ...
   9: 
  10:     public SequenceDiagram(Vector playerNames) {    
  11: 
  12:         ...
  13:         this.playerNames = playerNames;
  14:     playerNames.insertElementAt("", 0);

View Full Code Here
   1: 
   2:     private Vector _contents = new Vector();
   3: 
   4:         ...
   5: 
   6:     public Vector getContents() { return _contents; }
   7: 
   8:         ...
   9:          _contents.removeElementAt(index);
  10:          _contents.insertElementAt(fig, 0);
  11:       }
  12:         ...
  13:     _contents.removeElement(FigLayeredure);
  14:     _contents.insertElementAt(FigLayeredure, 0);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     private boolean separLast = false;
   6:     private Vector separToks = null;
   7:         ...
   8:     private Vector formatToks = null;
   9:     private int nSepars  = 0;
  10:         ...
  11:     if (nSepars == 0) {
  12:         separToks.insertElementAt(".", 1);

View Full Code Here

isEmpty

public boolean isEmpty()
Tests if this vector has no components.
Specified by:
isEmpty in interface List<E>
isEmpty in interface Collection<E>
Overrides:
isEmpty in interface AbstractCollection<E>
Returns:
true if and only if this vector has no components, that is, its size is zero; false otherwise.
Usages and Demos :

View More Examples of isEmpty()
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: {
   6:     public Vector articles;
   7: 
   8:         ...
   9:  
  10: public Catalogue(Vector arts)
  11: {
  12:         ...
  13: {
  14:     return articles.isEmpty();

View Full Code Here
   1:     private Map map;
   2:     private Vector keys;
   3: 
   4:         ...
   5:     GenericCollection(Vector keys, Map map) {
   6:         this.keys = keys;
   7:         ...
   8:     public boolean isEmpty() {
   9:         return keys.isEmpty();
  10:     }

View Full Code Here
   1: {
   2:   protected Vector fifo_=new Vector();
   3: 
   4:         ...
   5:   {
   6:     return fifo_.isEmpty();
   7:   }
   8:         ...
   9:     XmasBasicMessage r=null;
  10:     if(!fifo_.isEmpty())
  11:     {

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Set;
   4:         ...
   5: 
   6: Vector keys = new Vector();
   7: Vector values = new Vector();
   8:         ...
   9: {
  10:    return keys.isEmpty();
  11: }

View Full Code Here
   1: public class AssocArray extends Dictionary {
   2:   private Vector keys = new Vector();
   3:         ...
   4:   private Vector values = new Vector();
   5:   public int size() { return keys.size(); }
   6:         ...
   7:   public boolean isEmpty() {
   8:     return keys.isEmpty();
   9:   }

View Full Code Here

lastElement

public E lastElement()
Returns the last component of the vector.
Returns:
the last component of the vector, i.e., the component at index size() - 1.
Throws:
NoSuchElementException - if this vector is empty.
Usages and Demos :

View More Examples of lastElement()
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     {
   6:     ListBundNames = new Vector();
   7:     }
   8:         ...
   9:     {
  10:     return ListBundNames.lastElement();
  11:     }
  12:         ...
  13: 
  14:     private Vector ListBundNames;

View Full Code Here
   1: package csoap.xml.soap;
   2: import java.util.Vector;
   3: import java.io.*;
   4:         ...
   5:     
   6:     Vector elements; 
   7:         ...
   8:     Vector stat; 
   9:     Vector crush;
  10:         ...
  11:   {
  12:       String element = (String)elements.lastElement();

View Full Code Here
   1: 
   2:   private Vector pastryNodes;
   3: 
   4:         ...
   5:   private Vector pingClients;
   6: 
   7:         ...
   8: 
   9:     pastryNodes = new Vector();
  10:     pingClients = new Vector();
  11:         ...
  12:     try {
  13:       PastryNode lastnode = (PastryNode) pastryNodes.lastElement();

View Full Code Here
   1:   private NetworkSimulator simulator;
   2:   private Vector pastryNodes;
   3: 
   4:         ...
   5:     factory = new DirectPastryNodeFactory(new RandomNodeIdFactory(environment), simulator, environment);
   6:     pastryNodes = new Vector();
   7:   }
   8:         ...
   9:     try {
  10:       PastryNode lastnode = (PastryNode) pastryNodes.lastElement();
  11:       bootstrap = lastnode.getLocalHandle();

View Full Code Here
   1: 
   2:   private Vector pastryNodes;
   3: 
   4:         ...
   5:   private Vector pingClients;
   6: 
   7:         ...
   8: 
   9:     pastryNodes = new Vector();
  10:     pingClients = new Vector();
  11:         ...
  12:     try {
  13:       PastryNode lastnode = (PastryNode) pastryNodes.lastElement();

View Full Code Here

lastIndexOf

public int lastIndexOf(Object elem)
Returns the index of the last occurrence of the specified object in this vector.
Specified by:
lastIndexOf in interface List<E>
Overrides:
lastIndexOf in interface AbstractList<E>
Parameters:
elem - the desired component.
Returns:
the index of the last occurrence of the specified object in this vector, that is, the largest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found.
Usages and Demos :

View More Examples of lastIndexOf(Object elem)
   1: import java.util.Vector;
   2: public class FindVector {
   3:         ...
   4:   public static void main (String args[]) {
   5:     Vector v = new Vector();
   6:     for (int i=0, n=members.length; i<n; i++) {
   7:         ...
   8:     System.out.println("Where's Thoreau from end?: " + 
   9:       v.lastIndexOf("Thoreau"));
  10:     int index = 0;

View Full Code Here
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.lastIndexOf(o);
   7:  }
   8: 
   9: public ListIterator listIterator()

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem);

View Full Code Here

lastIndexOf

public int lastIndexOf(Object elem,
                       int index)
Searches backwards for the specified object, starting from the specified index, and returns an index to it.
Parameters:
elem - the desired component.
index - the index to start searching from.
Returns:
the index of the last occurrence of the specified object in this vector at position less than or equal to index in the vector, that is, the largest value k such that elem.equals(elementData[k]) && (k <= index) is true; -1 if the object is not found. (Returns -1 if index is negative.)
Throws:
IndexOutOfBoundsException - if index is greater than or equal to the current size of this vector.
Usages and Demos :

View More Examples of lastIndexOf(Object elem,int index)
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem, index);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem, index);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem, index);

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       return elements.lastIndexOf(elem, index);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Enumeration;
   4:         ...
   5: public final class StringVector {
   6:     Vector vector;
   7:     
   8:         ...
   9:     public final int lastIndexOf(String elem, int index) {
  10:         return vector.lastIndexOf(elem, index);
  11:     }

View Full Code Here

remove

public E remove(int index)
Removes the element at the specified position in this Vector. shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the Vector.
Specified by:
remove in interface List<E>
Overrides:
remove in interface AbstractList<E>
Parameters:
index - the index of the element to removed.
Returns:
element that was removed
Throws:
ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= size()).
Since:
1.2
Usages and Demos :

View More Examples of remove(int index)
   1: 
   2: import java.util.Vector;
   3: import org.jmock.core.Verifiable;
   4:         ...
   5: 
   6:     private final Vector myObjects = new Vector();
   7:     private final String myName;
   8:         ...
   9:                             myObjects.size() > 0);
  10:         return myObjects.remove(0);
  11:     }

View Full Code Here
   1:   private boolean     open_;
   2:   private Vector      queue_;
   3:   private LinkChannel channel_;
   4:         ...
   5:     open_    =true;
   6:     queue_   =new Vector(1);
   7:   }
   8:         ...
   9:             IsolateMessage r=(IsolateMessage)queue_.elementAt(0);
  10:             queue_.remove(0);
  11:             return r;

View Full Code Here
   1: 
   2:     public Vector items;
   3: 
   4:         ...
   5:                 Object item = items.get(0);
   6:                 items.remove(0);
   7:                 return item;
   8:             } catch (Exception e) {
   9:                 e.printStackTrace();

View Full Code Here
   1:     WebdavFile parentFile = new WebdavFile(httpURL);
   2:     Vector pathStack = new Vector();
   3:     
   4:         ...
   5:     
   6:     pathStack.remove(0);
   7: 
   8:     for (Iterator iterator = pathStack.iterator(); iterator.hasNext();) {
   9:         String path = (String) iterator.next();

View Full Code Here
   1: public class TypeProperty extends CGObjectProperty {
   2:     protected Vector types = new Vector();
   3: 
   4:         ...
   5: 
   6:     public TypeProperty(Vector types, boolean isConjunctive, String edit_string) {
   7:         super();
   8:         ...
   9:                     if (types.size() > 0)
  10:                         types.remove(0);
  11:                     types.insertElementAt(dialog.getType(), 0);

View Full Code Here

remove

public boolean remove(Object o)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists).
Specified by:
remove in interface List<E>
remove in interface Collection<E>
Overrides:
remove in interface AbstractCollection<E>
Parameters:
o - element to be removed from this Vector, if present.
Returns:
true if the Vector contained the specified element.
Since:
1.2
Usages and Demos :

View More Examples of remove(Object o)
   1: 
   2: import java.util.Vector;
   3: import org.jmock.core.Verifiable;
   4:         ...
   5: 
   6:     private final Vector myObjects = new Vector();
   7:     private final String myName;
   8:         ...
   9:                             myObjects.size() > 0);
  10:         return myObjects.remove(0);
  11:     }

View Full Code Here
   1:   private boolean     open_;
   2:   private Vector      queue_;
   3:   private LinkChannel channel_;
   4:         ...
   5:     open_    =true;
   6:     queue_   =new Vector(1);
   7:   }
   8:         ...
   9:             IsolateMessage r=(IsolateMessage)queue_.elementAt(0);
  10:             queue_.remove(0);
  11:             return r;

View Full Code Here
   1: 
   2:     public Vector items;
   3: 
   4:         ...
   5:                 Object item = items.get(0);
   6:                 items.remove(0);
   7:                 return item;
   8:             } catch (Exception e) {
   9:                 e.printStackTrace();

View Full Code Here
   1:     WebdavFile parentFile = new WebdavFile(httpURL);
   2:     Vector pathStack = new Vector();
   3:     
   4:         ...
   5:     
   6:     pathStack.remove(0);
   7: 
   8:     for (Iterator iterator = pathStack.iterator(); iterator.hasNext();) {
   9:         String path = (String) iterator.next();

View Full Code Here
   1: public class TypeProperty extends CGObjectProperty {
   2:     protected Vector types = new Vector();
   3: 
   4:         ...
   5: 
   6:     public TypeProperty(Vector types, boolean isConjunctive, String edit_string) {
   7:         super();
   8:         ...
   9:                     if (types.size() > 0)
  10:                         types.remove(0);
  11:                     types.insertElementAt(dialog.getType(), 0);

View Full Code Here

removeAll

public boolean removeAll(Collection c)
Removes from this Vector all of its elements that are contained in the specified Collection.
Specified by:
removeAll in interface List<E>
removeAll in interface Collection<E>
Overrides:
removeAll in interface AbstractCollection<E>
Parameters:
c - a collection of elements to be removed from the Vector
Returns:
true if this Vector changed as a result of the call.
Throws:
NullPointerException - if the specified collection is null.
Since:
1.2
Usages and Demos :

View More Examples of removeAll(Collection c)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.removeAll(c);
   7:  }
   8: 
   9: public boolean retainAll(Collection c)

View Full Code Here
   1: public class ListWrapper implements List {
   2:     private Vector myDelegee;
   3: 
   4:         ...
   5:     public ListWrapper() {
   6:         myDelegee = new Vector();
   7:     }
   8:         ...
   9:     public ListWrapper(int initialSize) {
  10:         myDelegee = new Vector(initialSize);
  11:     }
  12:         ...
  13:     public boolean removeAll(Collection c) {
  14:         return myDelegee.removeAll(c);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleSetImpl implements SecurityRoleSet {
   6:     private Vector roles = new Vector();
   7:     public SecurityRole get(String name) {
   8:         ...
   9:     public boolean removeAll(Collection arg0) {
  10:         return roles.removeAll(arg0);
  11:     }

View Full Code Here
   1: public class RelationTimeMap {
   2:   private Vector relations = new Vector();
   3: 
   4:         ...
   5:   public void addSpan (RelationSpan span) {
   6:     Vector boneyard = new Vector();
   7:     for (Iterator i = relations.iterator(); i.hasNext(); ) {
   8:         ...
   9:     }
  10:     relations.removeAll(boneyard);
  11:     relations.add(span);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleRefSetImpl implements SecurityRoleRefSet {
   6:     private Vector container = new Vector();
   7:     
   8:         ...
   9:     public boolean removeAll(Collection arg0) {
  10:         return container.removeAll(arg0);
  11:     }

View Full Code Here

removeAllElements

public void removeAllElements()
Removes all components from this vector and sets its size to zero.

This method is identical in functionality to the clear method (which is part of the List interface).

See Also:
clear(), List
Usages and Demos :

View More Examples of removeAllElements()
   1: 
   2: import java.util.Vector;
   3: import bingo.shared.PlayerRecord;
   4:         ...
   5: class Roster {
   6:     private Vector roster;
   7:     private int nextPlayerID = 0;
   8:         ...
   9:     Roster() {
  10:     roster = new Vector();
  11:     }
  12:         ...
  13:     void removeAllElements() {
  14:     roster.removeAllElements();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Set;
   4:         ...
   5: 
   6: Vector keys = new Vector();
   7: Vector values = new Vector();
   8:         ...
   9: {
  10:     keys.removeAllElements();
  11:         ...
  12:     values.removeAllElements();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class DUMMY extends Protocol {
   6:     final Vector   members=new Vector();
   7:     final String   name="DUMMY";
   8:         ...
   9:         synchronized(members) {
  10:         members.removeAllElements();
  11:         if(new_members != null && new_members.size() > 0)

View Full Code Here
   1:   protected long        centreBase;
   2:   protected Vector      tiers = new Vector();
   3: 
   4:         ...
   5: 
   6:     tiers.removeAllElements();
   7: 
   8:     _populateTiers(fset);

View Full Code Here
   1: public class MacroBar extends IconBar 
   2: {    Vector V=new Vector();
   3:     
   4:         ...
   5:     
   6:     public void update (Vector macros)
   7:     {    removeAll();
   8:         ...
   9:         V.removeAllElements();
  10:         Enumeration e=macros.elements();

View Full Code Here

removeElement

public boolean removeElement(Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.

This method is identical in functionality to the remove(Object) method (which is part of the List interface).

Parameters:
obj - the component to be removed.
Returns:
true if the argument was a component of this vector; false otherwise.
Usages and Demos :

View More Examples of removeElement(Object obj)
   1: import java.util.List;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         startNow = false;
   6:         Vector newargs = new Vector(args);
   7:         if (!newargs.isEmpty() && newargs.contains("now") ) {
   8:         ...
   9:             newargs.removeElement("now");
  10:             startNow = true;

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector objectList;
   7: 
   8:         ...
   9:     public OWLS_StoreImpl() {
  10:         objectList = new Vector();
  11:     }
  12:         ...
  13:     public boolean remove(OWLS_Object object) {
  14:         return objectList.removeElement(object);

View Full Code Here
   1: import java.util.List;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         mode = MODE_ON;
   6:         Vector newargs = new Vector(args);
   7:         if (newargs.isEmpty()) {
   8:         ...
   9:         } else if (newargs.contains("off")) {
  10:             newargs.removeElement("off");
  11:             mode = MODE_OFF;

View Full Code Here
   1:   implements MouseMotionListener, MouseListener {
   2:   private Vector listeners_;
   3:   public BCalqueSuiviSourisInteraction() {
   4:         ...
   5:     listeners_= new Vector();
   6:     setForeground(Color.magenta);
   7:         ...
   8:   public void removeCoordonneesListener(CoordonneesListener _l) {
   9:     listeners_.removeElement(_l);
  10:   }

View Full Code Here
   1: 
   2:   protected Vector  listeners_;
   3:   protected Thread  thread_;
   4:         ...
   5:     freshness_=_freshness;
   6:     listeners_=new Vector(1,1);
   7:   }
   8:         ...
   9:   {
  10:     listeners_.removeElement(_l);
  11:     if(listeners_.size()==0) thread_=null;

View Full Code Here

removeElementAt

public void removeElementAt(int index)
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1.

The index must be a value greater than or equal to 0 and less than the current size of the vector.

This method is identical in functionality to the remove method (which is part of the List interface). Note that the remove method returns the old value that was stored at the specified position.

Parameters:
index - the index of the object to remove.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
Usages and Demos :

View More Examples of removeElementAt(int index)
   1: import java.io.Serializable;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   private Vector contents;
   7: 
   8:         ...
   9:     {
  10:       contents = new Vector ();
  11:     }
  12:         ...
  13:       Object o = contents.firstElement ();
  14:       contents.removeElementAt(0);

View Full Code Here
   1: import java.io.*;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: {
   6:     private Vector requestVector;
   7:     private boolean closed = false;
   8:         ...
   9:     {
  10:         requestVector = new Vector(5);
  11:     }
  12:         ...
  13:             Object tmp = requestVector.elementAt(0);
  14:             requestVector.removeElementAt(0);

View Full Code Here
   1: {
   2:   protected Vector fifo_=new Vector();
   3: 
   4:         ...
   5:       r=(XmasBasicMessage)fifo_.elementAt(0);
   6:       fifo_.removeElementAt(0);
   7:     }
   8:         ...
   9:     System.err.println("%%% CANCEL "+_ref+" "+m.act()+" "+m.skill()+" "+m.content());
  10:     fifo_.removeElementAt(i);
  11:       }

View Full Code Here
   1: import java.util.Collection;
   2: import java.util.Vector;
   3: import junit.framework.AssertionFailedError;
   4:         ...
   5:     private String myName;
   6:     protected Vector myContents = new Vector();
   7:     private boolean myKeepUsingLastReturnValue = false;
   8:         ...
   9:         if (!shouldNotRemoveElement) {
  10:             myContents.removeElementAt(0);
  11:         }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     protected int id = -1;
   6:     protected Vector replies = null;
   7: 
   8:         ...
   9:         ICPReply reply = (ICPReply) replies.elementAt(0);
  10:         replies.removeElementAt(0);
  11:         return reply;
  12:         ...
  13:     ICPReply reply = (ICPReply) replies.elementAt(0);
  14:     replies.removeElementAt(0);

View Full Code Here

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the ArrayList by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
Overrides:
removeRange in interface AbstractList<E>
Parameters:
fromIndex - index of first element to be removed.
toIndex - index after last element to be removed.

retainAll

public boolean retainAll(Collection c)
Retains only the elements in this Vector that are contained in the specified Collection. In other words, removes from this Vector all of its elements that are not contained in the specified Collection.
Specified by:
retainAll in interface List<E>
retainAll in interface Collection<E>
Overrides:
retainAll in interface AbstractCollection<E>
Parameters:
c - a collection of elements to be retained in this Vector (all other elements are removed)
Returns:
true if this Vector changed as a result of the call.
Throws:
NullPointerException - if the specified collection is null.
Since:
1.2
Usages and Demos :

View More Examples of retainAll(Collection c)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:   return list.retainAll(c);
   7:  }
   8: 
   9: public Object set(int index, Object element)

View Full Code Here
   1: public class ListWrapper implements List {
   2:     private Vector myDelegee;
   3: 
   4:         ...
   5:     public ListWrapper() {
   6:         myDelegee = new Vector();
   7:     }
   8:         ...
   9:     public ListWrapper(int initialSize) {
  10:         myDelegee = new Vector(initialSize);
  11:     }
  12:         ...
  13:     public boolean retainAll(Collection c) {
  14:         return myDelegee.retainAll(c);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleSetImpl implements SecurityRoleSet {
   6:     private Vector roles = new Vector();
   7:     public SecurityRole get(String name) {
   8:         ...
   9:     public boolean retainAll(Collection arg0) {
  10:         return roles.retainAll(arg0);
  11:     }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SecurityRoleRefSetImpl implements SecurityRoleRefSet {
   6:     private Vector container = new Vector();
   7:     
   8:         ...
   9:     public boolean retainAll(Collection arg0) {
  10:         return container.retainAll(arg0);
  11:     }

View Full Code Here
   1: import java.util.Collection;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:   public static MatchSet createMatchSet(int flavour, String regExp, String text, Collection flags) {
   6:     Vector flavourFlags = new Vector(flags);
   7:         ...
   8:     flavourFlags.retainAll(MatchSetFactory.getAllFlags(flavour));
   9:     switch (flavour) {

View Full Code Here

set

public E set(int index,
             E element)
Replaces the element at the specified position in this Vector with the specified element.
Specified by:
set in interface List<E>
Overrides:
set in interface AbstractList<E>
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= size()).
Since:
1.2
Usages and Demos :

View More Examples of set(int index,E element)
   1: class SelProperties {
   2:    Vector ons=new Vector(4);
   3: 
   4:         ...
   5: 
   6:    public Vector locateCnVector(String n)
   7:    {
   8:         ...
   9:          }
  10:          ons.set(i+1,ar);
  11:       }

View Full Code Here
   1: import java.net.MalformedURLException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public static final String NAME = org.demo.webwader.gui.XmlDisplayer.NAME;
   6: private Vector param;
   7: 
   8:         ...
   9:   {
  10:       param = new Vector(1, 1);
  11:       setXmlDriver();
  12:         ...
  13:     try {
  14:     param.set(0, "RIP");

View Full Code Here
   1:   protected Nombre r_;
   2:   protected Vector liste_=new Vector(TAILLEMAX);
   3:   protected boolean fin_; 
   4:         ...
   5:   {
   6:     Vector temp=(Vector)liste_.clone();
   7:     Nombre zero=new Nombre(0);
   8:         ...
   9:             op(0).defNbrD(expr(1).evalue());
  10:             liste_.set(0,op(0).evalue());
  11:             supp(1);
  12:         ...
  13:               op(k).defNbrD(expr(k+1).evalue());
  14:               liste_.set(k,op(k).evalue());

View Full Code Here
   1: import pk.edu.niit.clarens.services.softwareDiscovery.SoftwarePackage;
   2: import java.util.Vector;
   3: import java.util.Date;
   4:         ...
   5: 
   6:         Vector paramNames = new Vector();
   7:         Vector paramValueTypes = new Vector();
   8:         ...
   9:                                 + packages[j].getPlatform();
  10:                             paramNames.set(0, softwareParam);
  11:         ...
  12:                             paramNames.set(1, "expire#" + softwareParam);

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     final Vector contents = _stylesheet.getContents();
   7:     final SyntaxTreeNode root = (SyntaxTreeNode)contents.elementAt(0);
   8:         ...
   9:         root.setParent(this);
  10:         contents.set(0, this);
  11:         parser.setTemplate(this);

View Full Code Here

setElementAt

public void setElementAt(E obj,
                         int index)
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded.

The index must be a value greater than or equal to 0 and less than the current size of the vector.

This method is identical in functionality to the set method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position.

Parameters:
obj - what the component is to be set to.
index - the specified index.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), List, set(int, java.lang.Object)
Usages and Demos :

View More Examples of setElementAt(E obj,int index)
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     }
   6:     protected FrameProcessor getProcessor(String name, Vector args) 
   7:     {
   8:         ...
   9:             System.err.println("VideoFrameAverage asked for unknown processor: "+name);
  10:             args.setElementAt("*Average*", 0);
  11:             return null;

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     }
   6:     protected FrameProcessor getProcessor(String name, Vector args) 
   7:     {
   8:         ...
   9:             System.err.println("BooleanPixelCount asked for unknown processor: "+name);
  10:             args.setElementAt("*BooleanPixelCount*", 0);
  11:             return null;

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     }
   6:     protected FrameProcessor getProcessor(String name, Vector args) 
   7:     {
   8:         ...
   9:             System.err.println("VideoBarCode1D asked for unknown processor: "+name);
  10:             args.setElementAt("*BarCode1D*", 0);
  11:             return null;

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: import java.awt.image.BufferedImage;
   4:         ...
   5: 
   6:     protected FrameProcessor getProcessor(String name, Vector args) 
   7:     {
   8:         ...
   9:             System.err.println("VideoFrameExporter asked for unknown processor: "+name);
  10:             args.setElementAt("*Export*", 0);
  11:             return null;

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.Vector;
   3: import java.net.URL;
   4:         ...
   5:     }
   6:     protected synchronized FrameProcessor getProcessor(String name, Vector args) 
   7:     {
   8:         ...
   9:             System.err.println("ARToolkitGlyphTracker asked for unknown processor: "+name);
  10:             args.setElementAt("*ARToolkitGlyph*", 0);
  11:             return null;

View Full Code Here

setSize

public void setSize(int newSize)
Sets the size of this vector. If the new size is greater than the current size, new null items are added to the end of the vector. If the new size is less than the current size, all components at index newSize and greater are discarded.
Parameters:
newSize - the new size of this vector.
Throws:
ArrayIndexOutOfBoundsException - if new size is negative.
Usages and Demos :

View More Examples of setSize(int newSize)
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class StateRecorder {
   6:     Vector savedObjects;
   7: 
   8:         ...
   9:     public StateRecorder() {
  10:         savedObjects = new Vector();
  11:     }
  12:         ...
  13:             }
  14:             savedObjects.setSize(checkpoint);

View Full Code Here
   1:             throw new ParseException("Empty list");
   2:         Vector res = new Vector(curNumberOfParameters);
   3:         ...
   4:         res.setSize(curNumberOfParameters);
   5:         for(int i=curNumberOfParameters-1;i>=0;--i)
   6:         {
   7:             Object param = inStack.pop();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:   Vector[] pool;
   7:   boolean[] inUse;
   8:         ...
   9:   {
  10:     pool = new Vector[initialPoolSize];
  11:     inUse = new boolean[initialPoolSize];
  12:         ...
  13:         inUse[i] = false;
  14:     v.setSize(0);

View Full Code Here
   1:     
   2:     private Vector variableList = new Vector();
   3:     
   4:         ...
   5:         
   6:         variableList.setSize(0);
   7:     }
   8:         ...
   9:     
  10:     public Vector getVariableList()
  11:     {

View Full Code Here
   1: import java.util.NoSuchElementException;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:             } else {
   6:                 v.setSize(0);
   7:                 i = 0;
   8:         ...
   9:             if (v == null)
  10:                 v = new Vector ();
  11:             v.addElement (obj);

View Full Code Here

size

public int size()
Returns the number of components in this vector.
Specified by:
size in interface List<E>
size in interface Collection<E>
Overrides:
size in interface AbstractCollection<E>
Returns:
the number of components in this vector.
Usages and Demos :

View More Examples of size()
   1: import org.mmbase.module.core.*;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector fields;
   7:         ...
   8:     private Vector sortDirs;
   9: 
  10:         ...
  11:         this.fields = fields;
  12:         sortDirs = new Vector(fields.size());

View Full Code Here
   1: import org.mmbase.module.core.*;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     private Vector fields;
   7:         ...
   8:     private Vector sortDirs;
   9: 
  10:         ...
  11:         this.fields = fields;
  12:         sortDirs = new Vector(fields.size());

View Full Code Here
   1: 
   2:   public Vector getNews() {
   3: 
   4:         ...
   5:     String method = "getNews";
   6:     Vector requests = null;
   7: 
   8:         ...
   9:       SoapObject request = createObject(method);
  10:       Vector result = (Vector)ht.call(request);
  11: 
  12:         ...
  13: 
  14:     Vector v = new Vector(requests.size());

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         xdebug.logMsg(this, "Testing is now on");
   6:         Vector messages = xdebug.getDebugMessages();
   7:         ...
   8:         assertTrue("Verifying that we get back 2 messages", messages.size() == 2);
   9:         ...
  10:         for (int i = 0; i < messages.size(); i++) {

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: 
   4:         ...
   5: 
   6:     Vector specs = new Vector(Model.getFacade().getSpecializations(c));
   7:     if (specs == null) {
   8:         ...
   9:     }
  10:     Vector specClasses = new Vector(specs.size());
  11:     Enumeration elems = specs.elements();

View Full Code Here

subList

public List subList(int fromIndex,
                       int toIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and ToIndex are equal, the returned List is empty.) The returned List is backed by this List, so changes in the returned List are reflected in this List, and vice-versa. The returned List supports all of the optional List operations supported by this List.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a List can be used as a range operation by operating on a subList view instead of a whole List. For example, the following idiom removes a range of elements from a List:

	    list.subList(from, to).clear();
 
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the List returned by this method become undefined if the backing list (i.e., this List) is structurally modified in any way other than via the returned List. (Structural modifications are those that change the size of the List, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Specified by:
subList in interface List<E>
Overrides:
subList in interface AbstractList<E>
Parameters:
fromIndex - low endpoint (inclusive) of the subList.
toIndex - high endpoint (exclusive) of the subList.
Returns:
a view of the specified range within this List.
Throws:
IndexOutOfBoundsException - endpoint index value out of range (fromIndex < 0 || toIndex > size)
IllegalArgumentException - endpoint indices out of order (fromIndex > toIndex)
Usages and Demos :

View More Examples of subList(int fromIndex,int toIndex)
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:    return list.subList(fromIndex, toIndex);
   7:  }
   8: 
   9: public Object[] toArray()

View Full Code Here
   1: 
   2: public class UnmodifiableVector extends Vector {
   3:         ...
   4:     Vector v;
   5: 
   6:         ...
   7:     public UnmodifiableVector(Vector v) {
   8:         this.v=v;
   9:         ...
  10:     public synchronized java.util.List subList(int fromIndex, int toIndex) {
  11:         return v.subList(fromIndex, toIndex);

View Full Code Here
   1: 
   2:   private Vector set;
   3: 
   4:         ...
   5:   public NodeSet() {
   6:     set = new Vector();
   7:   }
   8:         ...
   9: 
  10:   public NodeSet(Vector s) {
  11:     set = s;
  12:         ...
  13:     try {
  14:       res = new NodeSet(new Vector(set.subList(from, to)));

View Full Code Here

toArray

public Object[] toArray()
Returns an array containing all of the elements in this Vector in the correct order.
Specified by:
toArray in interface List<E>
toArray in interface Collection<E>
Overrides:
toArray in interface AbstractCollection<E>
Since:
1.2
Usages and Demos :

View More Examples of toArray()
   1: import java.util.Iterator;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     public static Object[] iterator2array(Iterator it) {
   6:         Vector v = new Vector();
   7: 
   8:         ...
   9: 
  10:         return v.toArray();
  11:     }

View Full Code Here
   1: {
   2:         Vector v = new Vector(Arrays.asList(new String[]{"dog", null}));
   3:         ...
   4:         Object[] objs = v.toArray();
   5:         print(objs);
   6:         ...
   7:         v.add(new Integer(0));
   8:         print( v.toArray() ); 
   9:     }

View Full Code Here
   1: 
   2:   Vector list = new Vector();
   3: 
   4:         ...
   5:  {
   6:   return list.toArray();
   7:  }
   8: 
   9: public Object[] toArray(Object[] a)

View Full Code Here
   1: public class ListWrapper implements List {
   2:     private Vector myDelegee;
   3: 
   4:         ...
   5:     public ListWrapper() {
   6:         myDelegee = new Vector();
   7:     }
   8:         ...
   9:     public ListWrapper(int initialSize) {
  10:         myDelegee = new Vector(initialSize);
  11:     }
  12:         ...
  13:     public Object[] toArray() {
  14:         return myDelegee.toArray();

View Full Code Here
   1: import java.util.Map;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     protected Object[] getItems() {
   6:         Vector items = new Vector();
   7: 
   8:         ...
   9: 
  10:         return items.toArray();
  11:     }

View Full Code Here

toString

public String toString()
Returns a string representation of this Vector, containing the String representation of each element.
Overrides:
toString in interface AbstractCollection<E>
Usages and Demos :

View More Examples of toString()
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class ParameterList {
   6:   private Vector list;
   7: 
   8:         ...
   9:   public ParameterList() {
  10:     list = new Vector();
  11: 
  12:         ...
  13:   
  14:   public String toString() { return list.toString(); }  

View Full Code Here
   1: {
   2:   private Vector values_;
   3: 
   4:         ...
   5:   public YapodStaticVectorQuery(Vector _values)
   6:   {
   7:         ...
   8:   public String toString()
   9:     { return values_.toString(); }
  10: }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5: public class ParameterList {
   6:     private Vector list;
   7: 
   8:         ...
   9:     public ParameterList() {
  10:         list = new Vector();
  11: 
  12:         ...
  13:   
  14:     public String toString() { return list.toString(); }  

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class ElementList extends NamedElement {
   6:     private Vector children = new Vector();
   7: 
   8:         ...
   9: public String toString() {
  10:     return children.toString();
  11: }

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: import java.util.Iterator;
   4:         ...
   5: public class ProcessList {
   6:     private Vector list;
   7:     
   8:         ...
   9:     public ProcessList() {
  10:         list = new Vector();
  11:     
  12:         ...
  13:         return null;
  14:     public String toString() { return list.toString(); }  

View Full Code Here

trimToSize

public void trimToSize()
Trims the capacity of this vector to be the vector's current size. If the capacity of this vector is larger than its current size, then the capacity is changed to equal the size by replacing its internal data array, kept in the field elementData, with a smaller one. An application can use this operation to minimize the storage of a vector.
Usages and Demos :

View More Examples of trimToSize()
   1:     BookInfo bInfo = new BookInfo();
   2:     Vector books=new Vector();
   3: 
   4:         ...
   5:     public void setBooks( Book[] bArr ) {
   6:     books = new Vector( bArr.length, 10 );
   7:     for( int i=0;i<bArr.length;i++ ) books.add( bArr[i] );
   8:         ...
   9:     public void trimToSize() {
  10:     books.trimToSize();
  11:     }

View Full Code Here
   1:     SegmentHeader header;
   2:     Vector atoms;
   3: 
   4:         ...
   5: 
   6:     Vector getAtoms() {
   7:     return(atoms);
   8:         ...
   9:     public Atom[] getAtomsArray() {
  10:     atoms.trimToSize();
  11:     Atom[] atomArr=new Atom[atoms.size()];

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.trimToSize();

View Full Code Here
   1: {
   2:    protected Vector elements;
   3: 
   4:         ...
   5:    {
   6:       elements = new Vector(size, 10);
   7:    }
   8:         ...
   9:    {
  10:       elements = new Vector();
  11:    }
  12:         ...
  13:    {
  14:       elements.trimToSize();

View Full Code Here
   1:    public void addSpecial(NodeToken s) {
   2:       if ( specialTokens == null ) specialTokens = new Vector();
   3:       specialTokens.addElement(s);
   4:         ...
   5:       if ( specialTokens == null ) return;
   6:       specialTokens.trimToSize();
   7:    }
   8:         ...
   9: 
  10:    public Vector specialTokens;

View Full Code Here