Search in sources :

Example 1 with CharCharPair

use of org.eclipse.collections.api.tuple.primitive.CharCharPair in project eclipse-collections by eclipse.

the class CharAdapter method zipChar.

/**
 * @since 9.1.
 */
@Override
public ImmutableList<CharCharPair> zipChar(CharIterable iterable) {
    int size = this.size();
    int othersize = iterable.size();
    MutableList<CharCharPair> target = Lists.mutable.withInitialCapacity(Math.min(size, othersize));
    CharIterator iterator = iterable.charIterator();
    for (int i = 0; i < size && i < othersize; i++) {
        target.add(PrimitiveTuples.pair(this.get(i), iterator.next()));
    }
    return target.toImmutable();
}
Also used : CharCharPair(org.eclipse.collections.api.tuple.primitive.CharCharPair) CharIterator(org.eclipse.collections.api.iterator.CharIterator)

Aggregations

CharIterator (org.eclipse.collections.api.iterator.CharIterator)1 CharCharPair (org.eclipse.collections.api.tuple.primitive.CharCharPair)1