use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class CharAdapter method toList.
@Override
public MutableCharList toList() {
int size = this.size();
CharArrayList list = new CharArrayList(size);
for (int i = 0; i < size; i++) {
list.add(this.get(i));
}
return list;
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class AbstractLazyIterableTestCase method collectCharWithTarget.
@Test
public void collectCharWithTarget() {
MutableCharCollection target = new CharArrayList();
MutableCharCollection result = this.lazyIterable.collectChar(PrimitiveFunctions.unboxIntegerToChar(), target);
Assert.assertEquals(CharArrayList.newListWith((char) 1, (char) 2, (char) 3, (char) 4, (char) 5, (char) 6, (char) 7), result.toList());
Assert.assertSame("Target list sent as parameter not returned", target, result);
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class AbstractImmutableSortedMap method collectChar.
@Override
public ImmutableCharList collectChar(CharFunction<? super V> charFunction) {
CharArrayList result = new CharArrayList(this.size());
this.forEach(new CollectCharProcedure<>(charFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.list.mutable.primitive.CharArrayList in project eclipse-collections by eclipse.
the class RandomAccessListAdapter 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 AbstractMutableSortedMap method collectChar.
@Override
public MutableCharList collectChar(CharFunction<? super V> charFunction) {
CharArrayList result = new CharArrayList(this.size());
this.forEach(new CollectCharProcedure<>(charFunction, result));
return result;
}
Aggregations