use of org.eclipse.collections.impl.set.mutable.primitive.ByteHashSet in project eclipse-collections by eclipse.
the class AbstractMutableSet method collectByte.
@Override
public MutableByteSet collectByte(ByteFunction<? super T> byteFunction) {
MutableByteSet result = new ByteHashSet();
this.forEach(new CollectByteProcedure<>(byteFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.ByteHashSet in project eclipse-collections by eclipse.
the class SetAdapter method collectByte.
@Override
public MutableByteSet collectByte(ByteFunction<? super T> byteFunction) {
ByteHashSet result = new ByteHashSet(this.size());
this.forEach(new CollectByteProcedure<>(byteFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.ByteHashSet in project eclipse-collections by eclipse.
the class AbstractImmutableSet method collectByte.
@Override
public ImmutableByteSet collectByte(ByteFunction<? super T> byteFunction) {
MutableByteSet result = new ByteHashSet();
this.forEach(new CollectByteProcedure<>(byteFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.set.mutable.primitive.ByteHashSet in project eclipse-collections by eclipse.
the class StackIterableTestCase method collectByteWithTarget.
@Override
@Test
public void collectByteWithTarget() {
ByteHashSet target = new ByteHashSet();
StackIterable<Integer> stack = this.newStackFromTopToBottom(1, 2, 3);
ByteHashSet result = stack.collectByte(PrimitiveFunctions.unboxIntegerToByte(), target);
Assert.assertEquals(ByteHashSet.newSetWith((byte) 1, (byte) 2, (byte) 3), result);
Assert.assertSame("Target sent as parameter not returned", target, result);
}
Aggregations