Package org.aksw.commons.io.block.impl
Class BlockEnumerator
java.lang.Object
org.aksw.commons.io.block.impl.BlockEnumerator
A helper that holds a reference to the current block
and automatically closes it when advancing to the next one.
*
IterState.advance();
IterState.closeCurrent();
IterState.current();
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockEnumerator(boolean yieldSelf, Ref<? extends Block> blockRef, Seekable seekable, boolean isFwd, boolean skipFirstClose) -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Move to the next or previous block based on the configured direction.static BlockEnumeratorvoidstatic BlockEnumeratorstatic BlockEnumeratorstatic BlockEnumeratorbooleanhasNext()
-
Field Details
-
blockRef
-
block
-
seekable
-
yieldSelf
protected boolean yieldSelf -
skipFirstClose
protected boolean skipFirstClose -
isFwd
protected boolean isFwd
-
-
Constructor Details
-
BlockEnumerator
-
-
Method Details
-
getCurrentBlockRef
-
getCurrentBlock
-
getCurrentSeekable
-
hasNext
public boolean hasNext() -
closeCurrent
public void closeCurrent() -
advance
public void advance()Move to the next or previous block based on the configured direction. -
fwd
public static BlockEnumerator fwd(boolean yieldSelf, Ref<? extends Block> blockRef, Seekable seekable) -
fwd
public static BlockEnumerator fwd(boolean yieldSelf, Ref<? extends Block> blockRef, Seekable seekable, boolean skipFirstClose) -
fwd
public static BlockEnumerator fwd(boolean yieldSelf, Ref<? extends Block> blockRef, boolean skipFirstClose) -
bwd
public static BlockEnumerator bwd(boolean yieldSelf, Ref<? extends Block> blockRef, Seekable seekable)
-