Search in sources :

Example 1 with ByteArrayList

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

the class SortedSetAdapter method collectByte.

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

Example 2 with ByteArrayList

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

the class AbstractLazyIterableTestCase method collectByteWithTarget.

@Test
public void collectByteWithTarget() {
    MutableByteCollection target = new ByteArrayList();
    MutableByteCollection result = this.lazyIterable.collectByte(PrimitiveFunctions.unboxIntegerToByte(), target);
    Assert.assertEquals(ByteArrayList.newListWith((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7), result.toList());
    Assert.assertSame("Target list sent as parameter not returned", target, result);
}
Also used : ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList) MutableByteCollection(org.eclipse.collections.api.collection.primitive.MutableByteCollection) Test(org.junit.Test)

Example 3 with ByteArrayList

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

the class OrderedMapAdapter method collectByte.

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

Example 4 with ByteArrayList

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

the class RandomAccessListAdapter method collectByte.

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

Example 5 with ByteArrayList

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

the class AbstractMutableSortedMap method collectByte.

@Override
public MutableByteList collectByte(ByteFunction<? super V> byteFunction) {
    ByteArrayList result = new ByteArrayList(this.size());
    this.forEach(new CollectByteProcedure<>(byteFunction, result));
    return result;
}
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