org.simpleflatmapper.util.EnumarableSpliterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-util Show documentation
Show all versions of sfm-util Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.util;
import java.util.Spliterator;
import java.util.function.Consumer;
public class EnumarableSpliterator implements Spliterator {
private final Enumarable enumarable;
public EnumarableSpliterator(Enumarable enumarable) {
this.enumarable = enumarable;
}
@Override
public boolean tryAdvance(Consumer super T> action) {
Enumarable lEnumarable = this.enumarable;
if (lEnumarable.next()) {
action.accept(lEnumarable.currentValue());
return true;
} else {
return false;
}
}
@Override
public void forEachRemaining(Consumer super T> action) {
Enumarable lEnumarable = this.enumarable;
while(lEnumarable.next()) {
action.accept(lEnumarable.currentValue());
}
}
@Override
public Spliterator trySplit() {
return null;
}
@Override
public long estimateSize() {
return Long.MAX_VALUE;
}
@Override
public int characteristics() {
return ORDERED;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy