Examples of removeElementAt()


Examples of java.util.Vector.removeElementAt()

        retval.addElement(tmp.elementAt(0));
        tmp.removeElementAt(0);
        while (tmp.size() != 0)
        {
            retval.insertElementAt(tmp.elementAt(0), getInt(rand, retval.size() + 1));
            tmp.removeElementAt(0);
        }
        return retval;
    }

    private static int getInt(
View Full Code Here

Examples of java.util.Vector.removeElementAt()

            // Remove MessageEntries since they are not mapped
            int index = 0;
            while (index < v.size()) {
                if (v.elementAt(index) instanceof MessageEntry) {
                    v.removeElementAt(index);
                } else {
                    index++;
                }
            }
View Full Code Here

Examples of java.util.Vector.removeElementAt()

   * @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

Examples of java.util.Vector.removeElementAt()

      }
    };
    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

Examples of java.util.Vector.removeElementAt()

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

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

Examples of java.util.Vector.removeElementAt()

    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

Examples of java.util.Vector.removeElementAt()

      }
    };
    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

Examples of java.util.Vector.removeElementAt()

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

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

Examples of java.util.Vector.removeElementAt()

            return true;
        }

        // take the first field name from the list, and remove
        final String fieldName = (String) names.elementAt(0);
        names.removeElementAt(0);

        if (LOG.isDebugEnabled()) {
            LOG.debug("includeField(Pl, Vec, Str):" + log("processing field", fieldName) + andlog("left", "" + names.size()));
        }
View Full Code Here

Examples of java.util.Vector.removeElementAt()

            // Remove MessageEntries since they are not mapped
            int index = 0;
            while (index < v.size()) {
                if (v.elementAt(index) instanceof MessageEntry) {
                    v.removeElementAt(index);
                } else {
                    index++;
                }
            }
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.