Class BlockEnumerator

java.lang.Object
org.aksw.commons.io.block.impl.BlockEnumerator

public class BlockEnumerator extends Object
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 Details

    • blockRef

      public Ref<? extends Block> blockRef
    • block

      public Block block
    • seekable

      public Seekable seekable
    • yieldSelf

      protected boolean yieldSelf
    • skipFirstClose

      protected boolean skipFirstClose
    • isFwd

      protected boolean isFwd
  • Constructor Details

    • BlockEnumerator

      protected BlockEnumerator(boolean yieldSelf, Ref<? extends Block> blockRef, Seekable seekable, boolean isFwd, boolean skipFirstClose)
  • Method Details

    • getCurrentBlockRef

      public Ref<? extends Block> getCurrentBlockRef()
    • getCurrentBlock

      public Block getCurrentBlock()
    • getCurrentSeekable

      public Seekable 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)