Package java.util

Examples of java.util.Vector.insertElementAt()


                }
                else
                {
                    o.insertElementAt(this.ordering.elementAt(i), 0);
                    v.insertElementAt(this.values.elementAt(i), 0);
                    a.insertElementAt(this.added.elementAt(i), 0);
                    count = 1;
                }
            }

            this.ordering = o;
View Full Code Here


          int offset = 0;
          for (int eji = theJDKId; eji > envJDKId; eji--) {
            offset += envModuleCount[eji];
          }

          implementations.insertElementAt(possibleModule, offset);
          envModuleCount[envJDKId]++;

        }
        else {
          // just add to the end of the vector
View Full Code Here

  public void test_insertElementAtLjava_lang_ObjectI() {
    // Test for method void
    // java.util.Vector.insertElementAt(java.lang.Object, int)
    Vector v = vectorClone(tVector);
    String prevElement = (String) v.elementAt(99);
    v.insertElementAt("Inserted Element", 99);
    assertEquals("Element not inserted", "Inserted Element", ((String) v.elementAt(99))
        );
    assertTrue("Elements shifted incorrectly", ((String) v.elementAt(100))
        .equals(prevElement));
    v.insertElementAt(null, 20);
View Full Code Here

    v.insertElementAt("Inserted Element", 99);
    assertEquals("Element not inserted", "Inserted Element", ((String) v.elementAt(99))
        );
    assertTrue("Elements shifted incorrectly", ((String) v.elementAt(100))
        .equals(prevElement));
    v.insertElementAt(null, 20);
    assertNull("null not inserted", v.elementAt(20));
  }

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

        dos.writeShort(0);
        dos.writeInt(textLen);
        dos.writeShort(allRecs.size());
        dos.writeShort(maxRecSize);
        dos.writeInt(0);
        allRecs.insertElementAt(new Record(bos.toByteArray()), 0);

        // Convert Vector of Records to an array and return it.
        int nRecs = allRecs.size();
        Record recs[] = new Record[nRecs];
        for (int i = 0; i < nRecs; i++)
View Full Code Here

     */
    public byte[] getCertificateData(boolean reverse, X509Certificate[] certs) throws WSSecurityException {
        Vector list = new Vector();
        for (int i = 0; i < certs.length; i++) {
            if (reverse) {
                list.insertElementAt(certs[i], 0);
            } else {
                list.add(certs[i]);
            }
        }
        try {
View Full Code Here

        dos.writeShort(0);
        dos.writeInt(textLen);
        dos.writeShort(allRecs.size());
        dos.writeShort(maxRecSize);
        dos.writeInt(0);
        allRecs.insertElementAt(new Record(bos.toByteArray()), 0);

        // Convert Vector of Records to an array and return it.
        int nRecs = allRecs.size();
        Record recs[] = new Record[nRecs];
        for (int i = 0; i < nRecs; i++)
View Full Code Here

                for (i=0; i<sortedAttributes.size(); i++) {
                    if (attributeName.compareTo((String) sortedAttributes.elementAt(i)) < 0) {
                        break;
                    }
                }
                sortedAttributes.insertElementAt(attributeName, i);
            }

            // cat the attributes
            StringBuffer buffer = new StringBuffer();
            for (i=0; i<sortedAttributes.size(); i++) {
View Full Code Here

            pullQ.removeElementAt(0);

            switch (p.getPacketType()) {
            case CONN_ABORT_PACKET:
                removeConn = true;
                pullQ.insertElementAt(p, 0); // Let all threads find the CONN_ABORT_PACKET
                pullQ.notifyAll();

                break;

            case CONN_SHUTDOWN:
View Full Code Here

                break;

            case CONN_SHUTDOWN:
                removeConn = true;
                pullQ.insertElementAt(p, 0); // Let all threads find the CONN_SHUTDOWN
                pullQ.notifyAll();
                p = null;

                break;
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.