com.bestvike.linq.adapter.enumerator.GenericArrayEnumerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of linq Show documentation
Show all versions of linq Show documentation
LINQ to Objects for Java.
The newest version!
package com.bestvike.linq.adapter.enumerator;
import com.bestvike.linq.enumerable.AbstractEnumerator;
/**
* Created by 许崇雷 on 2019-04-16.
*/
public final class GenericArrayEnumerator extends AbstractEnumerator {
private final TSource[] source;
public GenericArrayEnumerator(TSource[] source) {
this.source = source;
}
@Override
public boolean moveNext() {
if (this.state == -1)
return false;
if (this.state < this.source.length) {
this.current = this.source[this.state++];
return true;
}
this.close();
return false;
}
}