Package java.util

Examples of java.util.Vector.firstElement()


        for ( int p=0; p<pseudoVector.size(); p++ )
        {
          pseudoNode.addChild((PQNode)pseudoVector.elementAt(p), false);
        }
        pseudoNode.getEndMostChildren().addPQNode((PQNode)pseudoVector.firstElement());
        pseudoNode.getEndMostChildren().addPQNode((PQNode)pseudoVector.lastElement());
      }
      else
      {
        throw new Exception("*** ERROR no starting blocked node could be found to add to a new pseudonode!");
View Full Code Here


        ((PQNodeEx)stNode.getRef().getExtender()).setStNumber(stNode.getStNumber());
        nodesInStOrder.setElementAt(stNode.getRef().getExtender(), i);
      }

      tNode = (PQNodeEx)nodesInStOrder.lastElement();
      PQNodeEx currentNode = (PQNodeEx)nodesInStOrder.firstElement();
      upwardEdges.addElement(new Vector());
      enumEdges = currentNode.incidentEdges().elements();
      while ( enumEdges.hasMoreElements() )
      {
        pqTree.getRoot().addChild( ((PQEdgeEx)enumEdges.nextElement()).getPQNode() );
View Full Code Here

        for(Map.Entry<String, Vector> entry : entries) {
            String value = null;
            String key = (String) entry.getKey();
            Vector values = (Vector) entry.getValue();
            if(!values.isEmpty() && values.size() == 1) {
                value = (String) values.firstElement();
            } else if(values.size() > 1) {
                logFine("More than one value for key : " + key);
            }
            String prop = getParsedKey(key);
            driverProps.put(prop, value);
View Full Code Here

            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

 
  protected void writeSimpleTypeWithEnumerations() throws WrapperFault{
    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 ");
      if ("string".equals(baseType.getLocalPart()) || "NMTOKEN".equals(baseType.getLocalPart())){
View Full Code Here

  protected void writeSimpleTypeWithEnumerations() throws WrapperFault{
    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 ");
      if ("string".equals(baseType.getLocalPart())){
View Full Code Here

 
  protected void writeSimpleTypeWithEnumerations() throws WrapperFault{
    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 ");
      if ("string".equals(baseType.getLocalPart()) || "NMTOKEN".equals(baseType.getLocalPart())){
View Full Code Here

     * returns a ContainerTransaction if all the transactional methods on
     * the ejb descriptor have the same transaction type else return null
     */
    public ContainerTransaction getContainerTransaction() {
        Vector transactionalMethods = new Vector(this.getTransactionMethodDescriptors());
        MethodDescriptor md = (MethodDescriptor) transactionalMethods.firstElement();
        if (md != null) {
            ContainerTransaction first = this.getContainerTransactionFor(md);
            for (Enumeration e = transactionalMethods.elements(); e.hasMoreElements();) {
                MethodDescriptor next = (MethodDescriptor) e.nextElement();
                ContainerTransaction nextCt = this.getContainerTransactionFor(next);
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

    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

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.