Package java.util

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


    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

            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

            // 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

            for (int j = 0; j < size; j++) {
                String osEnvItem = (String) osEnv.elementAt(j);
                String convertedItem = environmentCaseInSensitive
                    ? osEnvItem.toLowerCase() : osEnvItem;
                if (convertedItem.startsWith(key)) {
                    osEnv.removeElementAt(j);
                    if (environmentCaseInSensitive) {
                        // Use the original casiness of the key
                        keyValue = osEnvItem.substring(0, key.length())
                            + keyValue.substring(key.length());
                    }
View Full Code Here

            if (pullQ.isEmpty()) {
                return null;
            }

            p = (HttpTunnelPacket) pullQ.elementAt(0);
            pullQ.removeElementAt(0);

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

           if(_listenerHash.containsKey(eventService)){
             Vector vCBack = (Vector)_listenerHash.get(eventService);
              for(int i=0; i < vCBack.size(); i++){
                    ScriptableFunction sf = (ScriptableFunction)vCBack.elementAt(i);
                    if(sf == callback){
                      vCBack.removeElementAt(i);
                      break; // removing the first callback only
                    }
              }
             
              //last callback was deleted
View Full Code Here

            if(_listenerHash.containsKey(emailService)){
              Vector vCBack = (Vector)_listenerHash.get(emailService);
               for(int i=0; i < vCBack.size(); i++){
                     ScriptableFunction sf = (ScriptableFunction)vCBack.elementAt(i);
                     if(sf == callback){
                       vCBack.removeElementAt(i);
                       break; // removing the first callback only
                     }
               }
              
               //last callback was deleted
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.