Search in sources :

Example 21 with ByteArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList in project eclipse-collections by eclipse.

the class ImmutableByteMapKeySetTest method generateCollisions.

protected static ByteArrayList generateCollisions() {
    ByteArrayList collisions = new ByteArrayList();
    ImmutableByteMapKeySet set = (ImmutableByteMapKeySet) new ByteShortHashMap().keySet().freeze();
    for (byte i = 2; collisions.size() <= 10; i++) {
        if (set.spreadAndMask(i) == set.spreadAndMask((byte) 2)) {
            collisions.add(i);
        }
    }
    return collisions;
}
Also used : ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)

Example 22 with ByteArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList in project eclipse-collections by eclipse.

the class ArrayListAdapter method collectByte.

@Override
public MutableByteList collectByte(ByteFunction<? super T> byteFunction) {
    ByteArrayList result = new ByteArrayList(this.size());
    this.each(each -> result.add(byteFunction.byteValueOf(each)));
    return result;
}
Also used : ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)

Example 23 with ByteArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList in project eclipse-collections by eclipse.

the class AbstractImmutableList method collectByte.

@Override
public ImmutableByteList collectByte(ByteFunction<? super T> byteFunction) {
    ByteArrayList result = new ByteArrayList(this.size());
    this.forEach(new CollectByteProcedure<>(byteFunction, result));
    return result.toImmutable();
}
Also used : ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)

Aggregations

ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)23 Test (org.junit.Test)11 MutableByteCollection (org.eclipse.collections.api.collection.primitive.MutableByteCollection)3 MutableByteList (org.eclipse.collections.api.list.primitive.MutableByteList)3 ArrayList (java.util.ArrayList)2 MutableByteSet (org.eclipse.collections.api.set.primitive.MutableByteSet)2 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)2 CharArrayList (org.eclipse.collections.impl.list.mutable.primitive.CharArrayList)2 DoubleArrayList (org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)2 FloatArrayList (org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)2 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)2 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2 ShortArrayList (org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList)2 BigInteger (java.math.BigInteger)1 ByteIterable (org.eclipse.collections.api.ByteIterable)1 ByteList (org.eclipse.collections.api.list.primitive.ByteList)1 ByteHashBag (org.eclipse.collections.impl.bag.mutable.primitive.ByteHashBag)1