Search in sources :

Example 6 with IntArrayList

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();
}
Also used : IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)

Example 7 with IntArrayList

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());
    }
}
Also used : IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList) Test(org.junit.Test)

Example 8 with IntArrayList

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;
}
Also used : MutableIntList(org.eclipse.collections.api.list.primitive.MutableIntList) IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)

Example 9 with IntArrayList

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;
}
Also used : MutableIntList(org.eclipse.collections.api.list.primitive.MutableIntList) IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)

Example 10 with IntArrayList

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;
}
Also used : MutableIntList(org.eclipse.collections.api.list.primitive.MutableIntList) IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)

Aggregations

IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)35 Test (org.junit.Test)10 MutableIntList (org.eclipse.collections.api.list.primitive.MutableIntList)8 MutableIntCollection (org.eclipse.collections.api.collection.primitive.MutableIntCollection)3 ArrayList (java.util.ArrayList)2 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)2 ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)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 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2 ShortArrayList (org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList)2 Nullable (org.jetbrains.annotations.Nullable)2 FingerPrint (il.technion.tinytable.hash.FingerPrint)1 java.io (java.io)1 BigInteger (java.math.BigInteger)1 java.util (java.util)1 BitSet (java.util.BitSet)1 Predicate (java.util.function.Predicate)1 ScriptException (javax.script.ScriptException)1