2021-10-13 00:23:56 +02:00
|
|
|
package it.cavallium.dbengine.lucene;
|
|
|
|
|
2022-06-30 15:06:10 +02:00
|
|
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
2021-12-18 21:01:14 +01:00
|
|
|
import it.cavallium.dbengine.database.SafeCloseable;
|
|
|
|
import java.io.Closeable;
|
2021-10-13 00:23:56 +02:00
|
|
|
import java.util.Iterator;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import reactor.core.publisher.Flux;
|
|
|
|
|
2022-06-30 15:06:10 +02:00
|
|
|
public interface ResourceIterable<T> extends DiscardingCloseable {
|
2021-10-13 00:23:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Iterate this PriorityQueue
|
|
|
|
*/
|
|
|
|
Flux<T> iterate();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Iterate this PriorityQueue
|
|
|
|
*/
|
|
|
|
default Flux<T> iterate(long skips) {
|
|
|
|
if (skips == 0) {
|
|
|
|
return iterate();
|
|
|
|
} else {
|
|
|
|
return iterate().skip(skips);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|