
com.github.leeonky.dal.runtime.DALCollection Maven / Gradle / Ivy
package com.github.leeonky.dal.runtime;
import com.github.leeonky.dal.IndexedElement;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterators;
import java.util.function.Predicate;
import java.util.stream.Stream;
public interface DALCollection extends Iterable> {
int size();
E getByIndex(int index);
int firstIndex();
DALCollection requireLimitedCollection(String message);
List collect();
default DALCollection filter(Predicate predicate) {
return new IterableDALCollection(() -> Spliterators.iterator(values().filter(predicate).spliterator())) {
@Override
public int firstIndex() {
return DALCollection.this.firstIndex();
}
};
}
Stream values();
Stream indexes();
DALCollection map(IndexedElement.Mapper super E, ? extends R> mapper);
Stream> stream();
boolean infinite();
DALCollection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy