Package java.util

Examples of java.util.Vector.firstElement()


    Address determineCoordinator() {
        Vector mbrs=my_view != null? my_view.getMembers() : null;
        if(mbrs == null)
            return null;
        if(mbrs.size() > 0)
            return (Address)mbrs.firstElement();
        return null;
    }

    /* ------------------------------- End of Private Methods ---------------------------------- */

 
View Full Code Here


    }

    Vector events = decodeEvents(document);

    if (events.size() > 0) {
      return (LoggingEvent) events.firstElement();
    }

    return null;
  }
View Full Code Here

        try
        {
            Vector restrictionData = type.getEnumerationdata();
            if (restrictionData == null)
                return;
            TypeEntry baseEType = (TypeEntry) restrictionData.firstElement();
            QName baseType = baseEType.getQName();
            if (!CUtils.isSimpleType(baseType))
                return;
            String langTypeName = CUtils.getclass4qname(baseType);
            writer.write("typedef ");
View Full Code Here

    classQ.addElement( clas );
    Method found = null;
    while ( classQ.size() > 0 )
    {
      Class c = (Class)classQ.firstElement();
      classQ.removeElementAt(0);

      // Is this it?
      // Is the class public or can we use accessibility?
      if ( Modifier.isPublic( c.getModifiers() )
View Full Code Here

            Vector restrictionData = type.getEnumerationdata();
            if (restrictionData == null)
            {
                return;
            }
            TypeEntry baseEType = (TypeEntry) restrictionData.firstElement();
            QName baseType = baseEType.getQName();
            if (!CUtils.isSimpleType(baseType))
            {
                return;
            }
View Full Code Here

    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

      }

      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

   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

    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

      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

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.