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

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


        return result.toImmutable();
    }

    public ImmutableByteList collectByte(ByteFunction<? super V> byteFunction)
    {
        ByteArrayList result = new ByteArrayList(this.size());
        this.forEach(new CollectByteProcedure<V>(byteFunction, result));
        return result.toImmutable();
    }
View Full Code Here


    private final ByteArrayList delegate;

    private ImmutableByteArrayStack(byte[] newElements)
    {
        this.checkOptimizedSize(newElements.length);
        this.delegate = new ByteArrayList(newElements);
    }
View Full Code Here

        return new ImmutableByteArrayStack(ByteArrayList.newList(items).reverseThis());
    }

    public ImmutableByteStack push(byte item)
    {
        ByteArrayList newDelegate = ByteArrayList.newList(this.delegate);
        newDelegate.add(item);
        return new ImmutableByteArrayStack(newDelegate);
    }
View Full Code Here

        return new ImmutableByteArrayStack(newDelegate);
    }

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

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

    {
        this.checkNegativeCount(count);
        this.checkSizeLessThanCount(count);
        if (count == 0)
        {
            return new ByteArrayList();
        }
        MutableByteList subList = new ByteArrayList(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

        }

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

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

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

    }

    @Override
    public MutableByteList collectByte(ByteFunction<? super T> byteFunction)
    {
        ByteArrayList result = new ByteArrayList(this.size());
        this.forEach(new CollectByteProcedure<T>(byteFunction, result));
        return result;
    }
View Full Code Here

        return result.toImmutable();
    }

    public ImmutableByteList collectByte(ByteFunction<? super T> byteFunction)
    {
        ByteArrayList result = new ByteArrayList();
        this.forEach(new CollectByteProcedure<T>(byteFunction, result));
        return result.toImmutable();
    }
View Full Code Here

    }

    @Override
    public MutableByteList collectByte(final ByteFunction<? super T> byteFunction)
    {
        final ByteArrayList result = new ByteArrayList(this.size());
        this.forEach(new Procedure<T>()
        {
            public void value(T each)
            {
                result.add(byteFunction.byteValueOf(each));
            }
        });
        return result;
    }
View Full Code Here

TOP

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

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.