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

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


        return (double) sortedArray[middleIndex];
    }

    public MutableShortList toList()
    {
        MutableShortList result = new ShortArrayList(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


            ShortFunction<? super T> shortFunction)
    {
        int size = list.size();
        if (ArrayListIterate.isOptimizableArrayList(list, size))
        {
            MutableShortList result = new ShortArrayList(size);
            return ArrayListIterate.collectShortFromInternalArray(list, shortFunction, size, result);
        }
        return RandomAccessListIterate.collectShort(list, shortFunction);
    }
View Full Code Here

    {
        if (objectArray == null)
        {
            throw new IllegalArgumentException("Cannot perform a collectShort on null");
        }
        MutableShortList result = new ShortArrayList(objectArray.length);
        for (T each : objectArray)
        {
            result.add(shortFunction.shortValueOf(each));
        }
        return result;
    }
View Full Code Here

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

    public MutableShortList toList()
    {
        final MutableShortList list = new ShortArrayList();
        this.forEach(new ShortProcedure()
        {
            public void value(short each)
            {
                list.add(each);
            }
        });
        return list;
    }
View Full Code Here

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

        this.checkSizeLessThanCount(count);
        if (count == 0)
        {
            return new ShortArrayList(0);
        }
        MutableShortList subList = new ShortArrayList(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 ImmutableShortArrayList(newItems);
    }

    public ImmutableShortList newWithoutAll(ShortIterable elements)
    {
        MutableShortList mutableShortList = this.toList();
        mutableShortList.removeAll(elements);
        return mutableShortList.toImmutable();
    }
View Full Code Here

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

TOP

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

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.