use of org.eclipse.collections.impl.list.mutable.primitive.IntArrayList in project eclipse-collections by eclipse.
the class AbstractImmutableList method collectInt.
@Override
public ImmutableIntList collectInt(IntFunction<? super T> intFunction) {
IntArrayList result = new IntArrayList(this.size());
this.forEach(new CollectIntProcedure<>(intFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.list.mutable.primitive.IntArrayList in project eclipse-collections by eclipse.
the class VerifyTest method assertNotEmpty_PrimitiveIterable.
@Test
public void assertNotEmpty_PrimitiveIterable() {
try {
Verify.assertNotEmpty(new IntArrayList());
Assert.fail();
} catch (AssertionError ex) {
Verify.assertContains("should be non-empty", ex.getMessage());
Verify.assertContains(VerifyTest.class.getName(), ex.getStackTrace()[0].toString());
}
}
use of org.eclipse.collections.impl.list.mutable.primitive.IntArrayList in project eclipse-collections by eclipse.
the class IntIntMapProbeTest method getSmallCollidingNumbers.
private MutableIntList getSmallCollidingNumbers() {
int lower = Integer.MIN_VALUE;
int upper = Integer.MAX_VALUE;
MutableIntList collidingNumbers = new IntArrayList();
int numberOne = this.smallMask(SpreadFunctions.intSpreadOne(0xABCDEF1));
int numberTwo = this.smallMask(SpreadFunctions.intSpreadTwo(0xABCDEF1));
for (int i = lower; i < upper && collidingNumbers.size() < SMALL_COLLIDING_KEY_COUNT; i++) {
if (this.smallMask(SpreadFunctions.intSpreadOne(i)) == numberOne && this.smallMask(SpreadFunctions.intSpreadTwo(i)) == numberTwo) {
collidingNumbers.add(i);
}
}
return collidingNumbers;
}
use of org.eclipse.collections.impl.list.mutable.primitive.IntArrayList in project eclipse-collections by eclipse.
the class IntIntMapProbeTest method getLargeCollidingNumbers.
private MutableIntList getLargeCollidingNumbers() {
int lower = Integer.MIN_VALUE;
int upper = Integer.MAX_VALUE;
int number = 23;
MutableIntList collidingNumbers = new IntArrayList();
for (int i = lower; i < upper && collidingNumbers.size() < LARGE_COLLIDING_KEY_COUNT; i++) {
int index = this.largeMask(SpreadFunctions.intSpreadOne(i));
if (index >= number && index <= number + 100) {
collidingNumbers.add(i);
}
}
return collidingNumbers;
}
use of org.eclipse.collections.impl.list.mutable.primitive.IntArrayList in project eclipse-collections by eclipse.
the class IntLongMapProbeTest method getLargeCollidingNumbers.
private MutableIntList getLargeCollidingNumbers() {
int lower = Integer.MIN_VALUE;
int upper = Integer.MAX_VALUE;
int number = 23;
MutableIntList collidingNumbers = new IntArrayList();
for (int i = lower; i < upper && collidingNumbers.size() < LARGE_COLLIDING_KEY_COUNT; i++) {
int index = this.largeMask(SpreadFunctions.intSpreadOne(i));
if (index >= number && index <= number + 100) {
collidingNumbers.add(i);
}
}
return collidingNumbers;
}
Aggregations