use of org.eclipse.collections.api.list.primitive.MutableCharList in project eclipse-collections by eclipse.
the class CharAdapter method newWithoutAll.
@Override
public CharAdapter newWithoutAll(CharIterable elements) {
MutableCharList mutableCharList = this.toList();
mutableCharList.removeAll(elements);
return new CharAdapter(new String(mutableCharList.toArray()));
}
use of org.eclipse.collections.api.list.primitive.MutableCharList in project eclipse-collections by eclipse.
the class CharAdapter method newWithAll.
@Override
public CharAdapter newWithAll(CharIterable elements) {
MutableCharList mutableCharList = this.toList();
mutableCharList.addAll(elements);
return new CharAdapter(new String(mutableCharList.toArray()));
}
use of org.eclipse.collections.api.list.primitive.MutableCharList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectCharWithTargetOverOptimizeLimit.
@Test
public void collectCharWithTargetOverOptimizeLimit() {
ArrayList<Integer> list = new ArrayList<>(Interval.zeroTo(OVER_OPTIMIZED_LIMIT));
MutableCharList target = new CharArrayList();
MutableCharList actual = ArrayListIterate.collectChar(list, PrimitiveFunctions.unboxIntegerToChar(), target);
CharArrayList expected = new CharArrayList(list.size());
for (int i = 0; i <= OVER_OPTIMIZED_LIMIT; i++) {
expected.add((char) i);
}
Assert.assertEquals(expected, actual);
Assert.assertSame("Target sent as parameter was not returned as result", target, actual);
}
use of org.eclipse.collections.api.list.primitive.MutableCharList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectChar.
@Test
public void collectChar() {
ArrayList<Integer> list = this.createIntegerList();
MutableCharList actual = ArrayListIterate.collectChar(list, PrimitiveFunctions.unboxIntegerToChar());
Assert.assertEquals(CharArrayList.newListWith((char) -1, (char) 0, (char) 4), actual);
}
use of org.eclipse.collections.api.list.primitive.MutableCharList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectCharWithTarget.
@Test
public void collectCharWithTarget() {
ArrayList<Integer> list = this.createIntegerList();
MutableCharList target = new CharArrayList();
MutableCharList actual = ArrayListIterate.collectChar(list, PrimitiveFunctions.unboxIntegerToChar(), target);
Assert.assertSame("Target list sent as parameter not returned", target, actual);
Assert.assertEquals(CharArrayList.newListWith((char) -1, (char) 0, (char) 4), actual);
}
Aggregations