Examples of toArray()


Examples of java.util.Stack.toArray()

    Stack stack = new Stack();
    for (Class tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
      pushDeclaredFields(tempClass, stack);
    }
    Collections.reverse(stack);
    return (Field[]) stack.toArray(new Field[stack.size()]);
  }
 
  /**
   * Return all the methods for the
   * specified class, including inherited methods.
View Full Code Here

Examples of java.util.TreeSet.toArray()

      }
      newsb.append(cl);
    }// end of for
    newsb.append(" ) ");
    String finalSql = " Select " + primaryType + " from ";
    Object[] objArray = globalSet.toArray();
    for (int j = 0; j < objArray.length; j++)
    {
      finalSql = finalSql + " " + (String)objArray[j];
      if (j < objArray.length - 1)
      {
View Full Code Here

Examples of java.util.Vector.toArray()

      }
      rs.close();
      s.close();

      String[] result = new String[v.size()];
      result = (String[]) v.toArray(result);

      return result;
    } catch (SQLException sqle) {
      if (sqle instanceof com.mysql.jdbc.CommunicationsException && !reconnectLoop) {
          logger.log(BasicLevel.WARN, "Database reconnection problem at list, Reconnecting");
View Full Code Here

Examples of java.util.concurrent.BlockingQueue.toArray()

     */
    @Test
    public void testToArray1_BadArg() {
        BlockingQueue q = populatedQueue(SIZE);
        try {
            q.toArray(new String[10]);
            shouldThrow();
        } catch (ArrayStoreException success) {
        }
    }

View Full Code Here

Examples of java.util.concurrent.CopyOnWriteArraySet.toArray()

            heroString = heroString.replace("game_sounds_", "");
            NamedHero tempNamedHero = new NamedHero(heroString);
            heroList.remove(hero);
            heroList.add(tempNamedHero);
        }
        Object[] heroListArray = heroList.toArray();
        Arrays.sort(heroListArray);
        for (Object h : heroListArray)
        {
            NamedHero tempHero = (NamedHero) h;
            currentDropdown.addItem(tempHero);
View Full Code Here

Examples of javax.accessibility.AccessibleStateSet.toArray()

        AccessibleStateSet stateSet = SwingUtilities.getAccessibleStateSet(component1);
        assertTrue(stateSet.contains(AccessibleState.ENABLED));
        assertTrue(stateSet.contains(AccessibleState.FOCUSABLE));
        assertTrue(stateSet.contains(AccessibleState.VISIBLE));
        assertTrue(stateSet.contains(AccessibleState.OPAQUE));
        assertTrue(stateSet.toArray().length == 4);
        stateSet = SwingUtilities.getAccessibleStateSet(component3);
        assertTrue(stateSet.contains(AccessibleState.ENABLED));
        assertTrue(stateSet.contains(AccessibleState.FOCUSABLE));
        assertTrue(stateSet.contains(AccessibleState.RESIZABLE));
        //        assertTrue(stateSet.toArray().length == 3);
View Full Code Here

Examples of javax.management.AttributeList.toArray()

            ObjectName objName = ((JMXManagedObject)mbean).getObjectName();
            try
            {
                AttributeList list = mbsc.getAttributes(objName, attributes);
               
                for (Attribute attr : list.toArray(new Attribute[0]))
                {
                    tempResults.put(attr.getName(), attr.getValue());
                }
               
                List<Object> attributeValues = new ArrayList<Object>(attributes.length);
View Full Code Here

Examples of javax.persistence.Tuple.toArray()

    List<Tuple> results = em.createQuery( criteria ).getResultList();
    assertEquals( 1, results.size() );
    Object resultElement = results.get( 0 );
    assertTrue( "Check  result 'row' as Tuple", Tuple.class.isInstance( resultElement ) );
    Tuple resultElementTuple = (Tuple) resultElement;
    Object[] tupleArray = resultElementTuple.toArray();
    assertEquals( 2, tupleArray.length );
    assertEquals( tupleArray[0], resultElementTuple.get( 0 ) );
    assertEquals( resultElementTuple.get( namePath ), resultElementTuple.get( 0 ) );
    assertEquals( tupleArray[1], resultElementTuple.get( 1 ) );
    assertEquals( resultElementTuple.get( agePath ), resultElementTuple.get( 1 ) );
View Full Code Here

Examples of javax.print.attribute.AttributeSet.toArray()

    {
        AttributeSet asUnsupported = ps.getUnsupportedAttributes(flavor,
                                                                 aset);

        if (asUnsupported != null) {
            Attribute[] usAttrs = asUnsupported.toArray();

            for (int i=0; i<usAttrs.length; i++) {
                Class category = usAttrs[i].getCategory();

                if (ps.isAttributeCategorySupported(category)) {
View Full Code Here

Examples of javax.print.attribute.DocAttributeSet.toArray()

            }
        }

        DocAttributeSet docSet = doc.getAttributes();
        if (docSet != null) {
            attrs = docSet.toArray();
            for (int i=0; i<attrs.length; i++) {
                if (attrs[i] instanceof PrintRequestAttribute) {
                    reqAttrSet.add(attrs[i]);
                }
                if (attrs[i] instanceof PrintJobAttribute) {
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.