Package java.util

Examples of java.util.Vector.removeElementAt()


      else if (encoding.equalsIgnoreCase("identity"))
      {
         if (log.isDebugEnabled())
            log.debug("Ignoring 'identity' token");

         pce.removeElementAt(pce.size() - 1);
      }
      else
      {
         if (log.isDebugEnabled())
            log.debug("Unknown content encoding '" + encoding + "'");
View Full Code Here


      if (te_hdr != null)
      {
         te_chunked = ((HttpHeaderElement)te_hdr.lastElement()).getName().equalsIgnoreCase("chunked");
         for (int idx = 0; idx < te_hdr.size(); idx++)
            if (((HttpHeaderElement)te_hdr.elementAt(idx)).getName().equalsIgnoreCase("identity"))
               te_hdr.removeElementAt(idx--);
            else
               te_is_identity = false;
      }

      // parse Content-Type header
View Full Code Here

            for (int idx = 0; idx < pco.size(); idx++)
            {
               String name = ((HttpHeaderElement)pco.elementAt(idx)).getName();
               if (!name.equalsIgnoreCase("keep-alive"))
               {
                  pco.removeElementAt(idx);
                  deleteHeader(name);
                  idx--;
               }
            }
View Full Code Here

            for (int idx = 0; idx < pco.size(); idx++)
            {
               String name = ((HttpHeaderElement)pco.elementAt(idx)).getName();
               if (!name.equalsIgnoreCase("keep-alive"))
               {
                  pco.removeElementAt(idx);
                  deleteHeader(name);
                  idx--;
               }
            }
View Full Code Here

               log.debug("Unknown transfer encoding '" + encoding + "'");

            break;
         }

         pte.removeElementAt(pte.size() - 1);
      }

      if (pte.size() > 0)
         resp.setHeader("Transfer-Encoding", Util.assembleHeader(pte));
      else
View Full Code Here

        for (int i = 0; i < arr.size(); i++)
        {
            tmp.addElement(arr.elementAt(i));
        }
        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);
        }
View Full Code Here

        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

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

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

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.