Package gnu.trove.stack

Examples of gnu.trove.stack.TIntStack.push()


        assertEquals( 0, array.length );

        stack.push( 10 );
        stack.push( 20 );
        stack.push( 30 );
        stack.push( 40 );

        array = stack.toArray();
        assertNotNull( array );
        assertEquals( 4, array.length );
        // NOTE: Top element in stack should be first element in array
View Full Code Here


    public void testClear() {
        TIntStack stack = new TIntArrayStack();

        assertEquals( 0, stack.size() );

        stack.push( 10 );

        assertEquals( 1, stack.size() );
        assertEquals( 10, stack.pop() );
        assertEquals( 0, stack.size() );
View Full Code Here

        assertEquals( 1, stack.size() );
        assertEquals( 10, stack.pop() );
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        stack.push( 30 );

        assertEquals( 3, stack.size() );
        stack.clear();
View Full Code Here

        assertEquals( 1, stack.size() );
        assertEquals( 10, stack.pop() );
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        stack.push( 30 );

        assertEquals( 3, stack.size() );
        stack.clear();
View Full Code Here

        assertEquals( 10, stack.pop() );
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        stack.push( 30 );

        assertEquals( 3, stack.size() );
        stack.clear();

        assertEquals( 0, stack.size() );
View Full Code Here

    public void testEquals() {
        TIntStack stack = new TIntArrayStack();
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        assertEquals( 2, stack.size() );

        TIntStack other = new TIntArrayStack( 20 );
        other.push( 10 );
View Full Code Here

    public void testEquals() {
        TIntStack stack = new TIntArrayStack();
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        assertEquals( 2, stack.size() );

        TIntStack other = new TIntArrayStack( 20 );
        other.push( 10 );
        other.push( 20 );
View Full Code Here

        stack.push( 10 );
        stack.push( 20 );
        assertEquals( 2, stack.size() );

        TIntStack other = new TIntArrayStack( 20 );
        other.push( 10 );
        other.push( 20 );
        assertEquals( 2, other.size() );

        assertTrue( "stacks should equal itself: " + stack,
      stack.equals( stack ) );
View Full Code Here

        stack.push( 20 );
        assertEquals( 2, stack.size() );

        TIntStack other = new TIntArrayStack( 20 );
        other.push( 10 );
        other.push( 20 );
        assertEquals( 2, other.size() );

        assertTrue( "stacks should equal itself: " + stack,
      stack.equals( stack ) );
View Full Code Here

    public void testHashCode() {
        TIntStack stack = new TIntArrayStack();
        assertEquals( 0, stack.size() );

        stack.push( 10 );
        stack.push( 20 );
        assertEquals( 2, stack.size() );

        TIntStack other = new TIntArrayStack( 20 );
        other.push( 10 );
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.