Demos and Usage of java.util.Vector.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
   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
   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
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5: public class SimpleQueue {
   6:     private Vector theQueue;
   7: 
   8:         ...
   9:     public SimpleQueue() {
  10:         theQueue = new Vector();
  11:     }
  12:         ...
  13: 
  14:         return theQueue.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:     private boolean stopWaiting=false;
   8:         ...
   9:         return null;
  10:     return vector.elementAt(0);
  11:     }

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

View Full Code Here
   1: import java.util.StringTokenizer;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     StringTokenizer st = new StringTokenizer((String) tokens[0], ".");
   6:     Vector vlhs = new Vector();
   7:     String vls;
   8:         ...
   9:         for(int i=0; i<vs;i++) {
  10:         vlhs.addElement(vlhs.elementAt(vs-i-1));
  11:         vlhs.removeElementAt(vs-i-1);

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.Vector;
   3: 
   4:         ...
   5:     StringBuffer out = new StringBuffer();
   6:     Vector v = new Vector();
   7:     String line;
   8:         ...
   9:     if ( v.size() == 1 ) {
  10:       return v.elementAt( 0 );
  11:     }

View Full Code Here
   1: import java.util.Vector;
   2: import Utilities.*;
   3:         ...
   4:    private boolean isWriting = false;
   5:    private Vector waitingReaders = new Vector();
   6:    private Vector waitingWriters = new Vector();
   7:         ...
   8:       if (numReaders == 0 && waitingWriters.size() > 0) {
   9:          synchronized (waitingWriters.elementAt(0)) {
  10:         ...
  11:             waitingWriters.elementAt(0).notify();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:   private long hash;
   6:   private Vector vec;
   7:   private int ptr;
   8:         ...
   9:     if (vec == null)
  10:       vec = new Vector();
  11:     return (new DummyObjectOutputStream());
  12:         ...
  13:       {
  14:         boolean primitive = ((Boolean)vec.elementAt(i)).booleanValue();

View Full Code Here
   1: 
   2: import java.util.Vector;
   3: 
   4:         ...
   5:         BusinessEntity obj = new BusinessEntity();
   6:         Vector nodeList = null;
   7:         AbstractHandler handler = null;
   8:         ...
   9:             handler = maker.lookup(NameHandler.TAG_NAME);
  10:             obj.addName((Name) handler.unmarshal((Element) nodeList.elementAt(i)));
  11:         }
  12:         ...
  13:             obj.addDescription((Description) handler.unmarshal((Element)
  14:                 nodeList.elementAt(i)));

View Full Code Here