All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bestvike.linq.adapter.enumerator.GenericArrayEnumerator Maven / Gradle / Ivy

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy