use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectCharOverOptimizeLimit.
@Test
public void collectCharOverOptimizeLimit() {
ArrayList<Integer> list = new ArrayList<>(Interval.zeroTo(OVER_OPTIMIZED_LIMIT));
MutableCharList actual = ArrayListIterate.collectChar(list, PrimitiveFunctions.unboxIntegerToChar());
CharArrayList expected = new CharArrayList(list.size());
for (int i = 0; i <= OVER_OPTIMIZED_LIMIT; i++) {
expected.add((char) i);
}
Assert.assertEquals(expected, actual);
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class SortedSetAdapter method collectChar.
@Override
public MutableCharList collectChar(CharFunction<? super T> charFunction) {
CharArrayList result = new CharArrayList(this.size());
this.forEach(new CollectCharProcedure<>(charFunction, result));
return result;
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class TreeSortedSet method collectChar.
@Override
public MutableCharList collectChar(CharFunction<? super T> charFunction) {
CharArrayList result = new CharArrayList(this.size());
this.forEach(new CollectCharProcedure<>(charFunction, result));
return result;
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class ArrayListAdapter method collectChar.
@Override
public MutableCharList collectChar(CharFunction<? super T> charFunction) {
CharArrayList result = new CharArrayList(this.size());
this.each(each -> result.add(charFunction.charValueOf(each)));
return result;
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class ImmutableEmptySortedBagTest method collectChar.
@Override
@Test
public void collectChar() {
ImmutableSortedBag<Integer> bag = this.classUnderTest();
Assert.assertEquals(new CharArrayList(), bag.collectChar(PrimitiveFunctions.unboxIntegerToChar()));
}
Aggregations