Package java.util

Examples of java.util.Vector.removeElementAt()


                    // perl scripts use &.  However, we cannot include
                    // them in the wordChars() range of chars, since
                    // the single quote is between them and the rest of the
                    // chars. So we have to process them by hand.
                    partialarg = ((String) argvector.lastElement()) + (char) c;
                    argvector.removeElementAt(argvector.size() - 1);
                    break;

                case '"':
                case '\'':
View Full Code Here


            // Get key including "="
            String key = env[i].substring(0, pos+1);
            int size = osEnv.size();
            for (int j = 0; j < size; j++) {
                if (((String)osEnv.elementAt(j)).startsWith(key)) {
                    osEnv.removeElementAt(j);
                    break;
                }
            }
            osEnv.addElement(env[i]);
        }
View Full Code Here

    Thread t1 = new Thread() {
      public void run() {
        for (int i = 0; i < iterations; i++) {
          synchronized (v) {
            v.addElement(String.valueOf(i));
            v.removeElementAt(0);
          }
        }
      }
    };
    t1.start();
View Full Code Here

      }
    };
    t1.start();
    for (int i = 0; i < 10000; i++) {
      synchronized (v) {
        v.removeElementAt(0);
        v.addElement(String.valueOf(i));
      }
      int size;
      if ((size = v.size()) != 1) {
        String result = "Size is not 1: " + size + " " + v;
View Full Code Here

        v.removeAllElements();
        fail(result);
      }
    }
    // terminate the thread
    v.removeElementAt(0);
  }

  /**
   * @tests java.util.Vector#lastElement()
   */
 
View Full Code Here

   * @tests java.util.Vector#removeElementAt(int)
   */
  public void test_removeElementAtI() {
    // Test for method void java.util.Vector.removeElementAt(int)
    Vector v = vectorClone(tVector);
    v.removeElementAt(50);
    assertEquals("Failed to remove element", -1, v.indexOf("Test 50", 0));
    tVector.insertElementAt(null, 60);
    tVector.removeElementAt(60);
    assertNotNull("Element at 60 should not be null after removal", tVector
        .elementAt(60));
View Full Code Here

      }
    };
    t1.start();
    for (int i = 0; i < 10000; i++) {
      synchronized (v) {
        v.removeElementAt(0);
        v.addElement(String.valueOf(i));
      }
      int size;
      if ((size = v.size()) != 1) {
        String result = "Size is not 1: " + size + " " + v;
View Full Code Here

        v.removeAllElements();
        fail(result);
      }
    }
    // terminate the thread
    v.removeElementAt(0);
  }

  /**
   * @tests java.util.Vector#subList(int, int)
   */
 
View Full Code Here

                0,
                this.rgbInput.getWidth(),
                this.rgbInput.getHeight()));
        while (!vecRNotOk.isEmpty()) {
            Rect r = (Rect) vecRNotOk.elementAt(0);
            vecRNotOk.removeElementAt(0);
            if (r.getHeight() >= 2 && r.getWidth() >= 2) {
                MeanVar nVar = computeVariance(r);
                if (nVar.getRVar()>this.nRVar ||
                        nVar.getGVar()>this.nGVar ||
                        nVar.getB()>this.nBVar) {
View Full Code Here

  for (int i=0; i< states.size() ; ) {
      VariantState state = (VariantState) states.elementAt(i) ;
      if ( state.getQ() > qmax ) {
    for (int j = i ; j > 0 ; j--)
        states.removeElementAt(0) ;
    qmax = state.getQ() ;
    i = 1 ;
      } else {
    if ( state.getQ() < qmax)
        states.removeElementAt(i) ;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.