Examples of firstElement()


Examples of java.util.Vector.firstElement()

      }

      if (pce.size() == 0)
         return;

      String encoding = ((HttpHeaderElement)pce.firstElement()).getName();
      if (encoding.equalsIgnoreCase("gzip") || encoding.equalsIgnoreCase("x-gzip"))
      {
         if (log.isDebugEnabled())
            log.debug("Pushing gzip-input-stream");
View Full Code Here

Examples of java.util.Vector.firstElement()

   private boolean isCoordinator(View newView)
   {
      if (newView != null && localAddress != null)
      {
         Vector mbrs = newView.getMembers();
         return mbrs != null && mbrs.size() > 0 && localAddress.equals(mbrs.firstElement());
      }

      /* Invalid new view, so previous value returned */
      return active;
   }
View Full Code Here

Examples of java.util.Vector.firstElement()

    assertEquals("Should not have removed any elements", 3, v.size());
    l = new LinkedList();
    l.add(null);
    v.removeAll(l);
    assertEquals("Should only have one element", 1, v.size());
    assertEquals("Element should be 'Boom'", "Boom", v.firstElement());
  }

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

Examples of java.util.Vector.firstElement()

      l.add("Test " + i);
    v.addElement(l);

    Collection s = new HashSet();
    Object o;
    s.add(o = v.firstElement());
    v.removeAll(s);
    assertTrue("Failed to remove items in collection", !v.contains(o));
    v.removeAll(l);
    assertTrue("Failed to remove all elements", v.isEmpty());
View Full Code Here

Examples of java.util.Vector.firstElement()

            TurbineResources.getVector("default.doctype", null);
        if (doctypeProperty != null && doctypeProperty.size() > 0)
        {
            if (doctypeProperty.size() == 1)
            {
                String doc = (String)doctypeProperty.firstElement();
                if (doc.equalsIgnoreCase("Html40Transitional"))
                {
                    data.getPage().setDoctype(new Doctype.Html40Transitional());
                }
                else if (doc.equalsIgnoreCase("Html40Strict"))
View Full Code Here

Examples of java.util.Vector.firstElement()

  }

  public Address getMasterAddress() {
    try {
      Vector members = channel.getView().getMembers();
      Address master = (Address) members.firstElement();
      channel.getState(master, 1000);
      return (Address) channel.getView().getMembers().firstElement();
    } catch (Exception e) {
      throw new RuntimeException(e.toString());
    }
View Full Code Here

Examples of java.util.Vector.firstElement()

         
        }
       
        //clean up closed consumer
        while (v.isEmpty() == false) {
          Object o = v.firstElement();
          connection.interestTable.remove( (Consumer) o);
          v.remove(o);
        }
       
    }
View Full Code Here

Examples of java.util.Vector.firstElement()

    void handleViewChange(View v) {
        Vector mbrs;
        if(local_addr == null)
            return;
        mbrs=v.getMembers();
        is_coord=mbrs != null && !mbrs.isEmpty() && local_addr.equals(mbrs.firstElement());
    }

    /**
     * @todo avoid sending up too many MERGE events.
     */
 
View Full Code Here

Examples of java.util.Vector.firstElement()

        Vector nestedRows = (Vector)fieldValue;
        if (nestedRows.isEmpty()) {
            return getObjectBuilder().createRecord(null);
        } else {
            // BUG#2667762 if the tag was empty this could be a string of whitespace.
            if (!(nestedRows.firstElement() instanceof XMLRecord)) {
                return getObjectBuilder().createRecord(null);
            }
            return (XMLRecord)nestedRows.firstElement();
        }
    }
View Full Code Here

Examples of java.util.Vector.firstElement()

        } else {
            // BUG#2667762 if the tag was empty this could be a string of whitespace.
            if (!(nestedRows.firstElement() instanceof XMLRecord)) {
                return getObjectBuilder().createRecord(null);
            }
            return (XMLRecord)nestedRows.firstElement();
        }
    }

    /**
     * INTERNAL:
 
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.