Package org.apache.commons.collections15.iterators

Examples of org.apache.commons.collections15.iterators.TestObjectGraphIterator$Tree


public class TreeTest
{
   public static void main( String args[] )
   {
      Tree tree = new Tree();
      int value;
      Random randomNumber = new Random();

      System.out.println( "Inserting the following values: " );

      // insert 10 random integers from 0-99 in tree
      for ( int i = 1; i <= 10; i++ )
      {
         value = randomNumber.nextInt( 100 );
         System.out.print( value + " " );
         tree.insertNode( value );
      } // end for

      System.out.println ( "\n\nPreorder traversal" );
      tree.preorderTraversal(); // perform preorder traversal of tree

      System.out.println ( "\n\nInorder traversal" );
      tree.inorderTraversal(); // perform inorder traversal of tree

      System.out.println ( "\n\nPostorder traversal" );
      tree.postorderTraversal(); // perform postorder traversal of tree
      System.out.println();
   } // end main
View Full Code Here


        buffer.addAll(Arrays.asList(getFullElements()));
        return UnmodifiableBuffer.decorate(buffer);
    }

    public Collection makeConfirmedCollection() {
        ArrayStack list = new ArrayStack();
        return list;
    }
View Full Code Here

        ArrayStack list = new ArrayStack();
        return list;
    }

    public Collection makeConfirmedFullCollection() {
        ArrayStack list = new ArrayStack();
        list.addAll(Arrays.asList(getFullElements()));
        return list;
    }
View Full Code Here

        buffer.addAll(Arrays.asList(getFullElements()));
        return SynchronizedBuffer.decorate(buffer);
    }

    public Collection makeConfirmedCollection() {
        ArrayStack list = new ArrayStack();
        return list;
    }
View Full Code Here

        ArrayStack list = new ArrayStack();
        return list;
    }

    public Collection makeConfirmedFullCollection() {
        ArrayStack list = new ArrayStack();
        list.addAll(Arrays.asList(getFullElements()));
        return list;
    }
View Full Code Here

    protected Buffer decorateBuffer(Buffer buffer, Predicate predicate) {
        return PredicatedBuffer.decorate(buffer, predicate);
    }

    public Collection makeCollection() {
        return decorateBuffer(new ArrayStack(), truePredicate);
    }
View Full Code Here

    public Collection makeCollection() {
        return decorateBuffer(new ArrayStack(), truePredicate);
    }

    public Collection makeConfirmedCollection() {
        return new ArrayStack();
    }
View Full Code Here

    public Collection makeConfirmedCollection() {
        return new ArrayStack();
    }

    public Collection makeConfirmedFullCollection() {
        ArrayStack list = new ArrayStack();
        list.addAll(java.util.Arrays.asList(getFullElements()));
        return list;
    }
View Full Code Here

    }
   
    //------------------------------------------------------------
   
    public Buffer makeTestBuffer() {
        return decorateBuffer(new ArrayStack(), testPredicate);
    }
View Full Code Here

        String[] testCaseName = {TestTransformedBuffer.class.getName()};
        junit.textui.TestRunner.main(testCaseName);
    }

    public void testTransformedBuffer() {
        Buffer buffer = TransformedBuffer.decorate(new ArrayStack(), TestTransformedCollection.STRING_TO_INTEGER_TRANSFORMER);
        assertEquals(0, buffer.size());
        Object[] els = new Object[]{"1", "3", "5", "7", "2", "4", "6"};
        for (int i = 0; i < els.length; i++) {
            buffer.add(els[i]);
            assertEquals(i + 1, buffer.size());
View Full Code Here

TOP

Related Classes of org.apache.commons.collections15.iterators.TestObjectGraphIterator$Tree

Copyright © 2018 www.massapicom. 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.