use of org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet in project eclipse-collections by eclipse.
the class SetAdapter method collectShort.
@Override
public MutableShortSet collectShort(ShortFunction<? super T> shortFunction) {
ShortHashSet result = new ShortHashSet(this.size());
this.forEach(new CollectShortProcedure<>(shortFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet in project eclipse-collections by eclipse.
the class StackIterableTestCase method collectShortWithTarget.
@Override
@Test
public void collectShortWithTarget() {
ShortHashSet target = new ShortHashSet();
StackIterable<Integer> stack = this.newStackFromTopToBottom(1, 2, 3);
ShortHashSet result = stack.collectShort(PrimitiveFunctions.unboxIntegerToShort(), target);
Assert.assertEquals(ShortHashSet.newSetWith((short) 1, (short) 2, (short) 3), result);
Assert.assertSame("Target sent as parameter not returned", target, result);
}
use of org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet in project eclipse-collections by eclipse.
the class AbstractImmutableSet method collectShort.
@Override
public ImmutableShortSet collectShort(ShortFunction<? super T> shortFunction) {
MutableShortSet result = new ShortHashSet(this.size());
this.forEach(new CollectShortProcedure<>(shortFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.set.mutable.primitive.ShortHashSet in project eclipse-collections by eclipse.
the class AbstractMutableSet method collectShort.
@Override
public MutableShortSet collectShort(ShortFunction<? super T> shortFunction) {
MutableShortSet result = new ShortHashSet(this.size());
this.forEach(new CollectShortProcedure<>(shortFunction, result));
return result;
}
Aggregations