Package com.gs.collections.impl.list.mutable.primitive

Examples of com.gs.collections.impl.list.mutable.primitive.IntArrayList


    private final IntArrayList delegate;

    private ImmutableIntArrayStack(int[] newElements)
    {
        this.checkOptimizedSize(newElements.length);
        this.delegate = new IntArrayList(newElements);
    }
View Full Code Here


        return new ImmutableIntArrayStack(IntArrayList.newList(items).reverseThis());
    }

    public ImmutableIntStack push(int item)
    {
        IntArrayList newDelegate = IntArrayList.newList(this.delegate);
        newDelegate.add(item);
        return new ImmutableIntArrayStack(newDelegate);
    }
View Full Code Here

        return new ImmutableIntArrayStack(newDelegate);
    }

    public ImmutableIntStack pop()
    {
        IntArrayList newDelegate = IntArrayList.newList(this.delegate);
        newDelegate.removeAtIndex(this.delegate.size() - 1);
        return IntStacks.immutable.with(newDelegate.toArray());
    }
View Full Code Here

        if (count == 0)
        {
            return this;
        }
        this.checkSizeLessThanCount(count);
        IntArrayList newDelegate = IntArrayList.newList(this.delegate);
        while (count > 0)
        {
            newDelegate.removeAtIndex(newDelegate.size() - 1);
            count--;
        }
        return IntStacks.immutable.with(newDelegate.toArray());
    }
View Full Code Here

    {
        this.checkNegativeCount(count);
        this.checkSizeLessThanCount(count);
        if (count == 0)
        {
            return new IntArrayList();
        }
        MutableIntList subList = new IntArrayList(count);
        int index = this.delegate.size() - 1;
        for (int i = 0; i < count; i++)
        {
            subList.add(this.delegate.get(index - i));
        }
        return subList;
    }
View Full Code Here

        return new int[0];
    }

    public MutableIntList toSortedList()
    {
        return new IntArrayList();
    }
View Full Code Here

        return ReverseIntIterable.adapt(this);
    }

    public MutableIntList toList()
    {
        return new IntArrayList();
    }
View Full Code Here

        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
        {
            int size = in.readInt();
            IntArrayList deserializedDelegate = new IntArrayList(size);

            for (int i = 0; i < size; i++)
            {
                deserializedDelegate.add(in.readInt());
            }

            this.stack = ImmutableIntArrayStack.newStackFromTopToBottom(deserializedDelegate);
        }
View Full Code Here

        return result.toImmutable();
    }

    public ImmutableIntList collectInt(IntFunction<? super T> intFunction)
    {
        IntArrayList result = new IntArrayList();
        this.forEach(new CollectIntProcedure<T>(intFunction, result));
        return result.toImmutable();
    }
View Full Code Here

    }

    @Override
    public MutableIntList collectInt(final IntFunction<? super T> intFunction)
    {
        final IntArrayList result = new IntArrayList(this.size());
        this.forEach(new Procedure<T>()
        {
            public void value(T each)
            {
                result.add(intFunction.intValueOf(each));
            }
        });
        return result;
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.impl.list.mutable.primitive.IntArrayList

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.