Package com.gs.collections.api.list.primitive

Examples of com.gs.collections.api.list.primitive.MutableByteList


        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".groupByUniqueKey() not implemented yet");
    }

    public MutableByteList collectByte(final ByteFunction<? super T> byteFunction)
    {
        final MutableByteList result = new ByteArrayList();
        this.forEachWithOccurrences(new ObjectIntProcedure<T>()
        {
            public void value(T each, int occurrences)
            {
                byte element = byteFunction.byteValueOf(each);
                for (int i = 0; i < occurrences; i++)
                {
                    result.add(element);
                }
            }
        });
        return result;
    }
View Full Code Here


            ByteFunction<? super T> byteFunction)
    {
        int size = list.size();
        if (ArrayListIterate.isOptimizableArrayList(list, size))
        {
            MutableByteList result = new ByteArrayList(size);
            return ArrayListIterate.collectByteFromInternalArray(list, byteFunction, size, result);
        }
        return RandomAccessListIterate.collectByte(list, byteFunction);
    }
View Full Code Here

    {
        if (objectArray == null)
        {
            throw new IllegalArgumentException("Cannot perform a collectByte on null");
        }
        MutableByteList result = new ByteArrayList(objectArray.length);
        for (T each : objectArray)
        {
            result.add(byteFunction.byteValueOf(each));
        }
        return result;
    }
View Full Code Here

        return this.toList().toArray();
    }

    public MutableByteList toList()
    {
        final MutableByteList list = new ByteArrayList();
        this.forEach(new ByteProcedure()
        {
            public void value(byte each)
            {
                list.add(each);
            }
        });
        return list;
    }
View Full Code Here

        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

        this.checkSizeLessThanCount(count);
        if (count == 0)
        {
            return new ByteArrayList(0);
        }
        MutableByteList subList = new ByteArrayList(count);
        while (count > 0)
        {
            subList.add(this.pop());
            count--;
        }
        return subList;
    }
View Full Code Here

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

        return new ImmutableByteArrayList(newItems);
    }

    public ImmutableByteList newWithoutAll(ByteIterable elements)
    {
        MutableByteList mutableByteList = this.toList();
        mutableByteList.removeAll(elements);
        return mutableByteList.toImmutable();
    }
View Full Code Here

        return (double) sortedArray[middleIndex];
    }

    public MutableByteList toList()
    {
        MutableByteList result = new ByteArrayList(this.size());

        for (int i = 0; i < this.keys.length; i++)
        {
            if (isNonSentinel(this.keys[i]))
            {
                result.add(this.values[i]);
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.api.list.primitive.MutableByteList

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.