Class AbstractShuttle

java.lang.Object
org.roaringbitmap.art.AbstractShuttle
All Implemented Interfaces:
Shuttle
Direct Known Subclasses:
BackwardShuttle, ForwardShuttle

public abstract class AbstractShuttle extends Object implements Shuttle
visit the art tree's space through a stack which records the deep first visiting paths.
  • Field Details

  • Constructor Details

    • AbstractShuttle

      public AbstractShuttle(Art art, Containers containers)
  • Method Details

    • initShuttle

      public void initShuttle()
      Description copied from interface: Shuttle
      should be called firstly before calling other methods
      Specified by:
      initShuttle in interface Shuttle
    • initShuttleFrom

      public void initShuttleFrom(long key)
      Description copied from interface: Shuttle
      Call this instead of initShuttle, if the iterator should start from a bound (upper/lower depending on direction)
      Specified by:
      initShuttleFrom in interface Shuttle
      Parameters:
      key - the upper/lower bound to start from
    • currentBeforeHigh

      protected abstract boolean currentBeforeHigh(byte[] current, byte[] high)
    • moveToNextLeaf

      public boolean moveToNextLeaf()
      Specified by:
      moveToNextLeaf in interface Shuttle
      Returns:
      true: has a LeafNode, false: has no LeafNode
    • visitedNodeNextPosition

      protected abstract int visitedNodeNextPosition(Node node, int pos)
    • getCurrentLeafNode

      public LeafNode getCurrentLeafNode()
      Description copied from interface: Shuttle
      get the current LeafNode after calling the method moveToNextLeaf
      Specified by:
      getCurrentLeafNode in interface Shuttle
      Returns:
      the current visiting LeafNode
    • remove

      public void remove()
      Description copied from interface: Shuttle
      remove the current visiting LeafNode and its corresponding value container
      Specified by:
      remove in interface Shuttle
    • visitToLeaf

      private void visitToLeaf(Node node, boolean inRunDirection)
    • visitToLeafFrom

      private void visitToLeafFrom(byte[] high, int keyDepth, Node node)
    • boundaryNodePosition

      protected abstract int boundaryNodePosition(Node node, boolean inRunDirection)
    • prefixMismatchIsInRunDirection

      protected abstract boolean prefixMismatchIsInRunDirection(byte nodeValue, byte highValue)
    • searchMissNextPosition

      protected abstract int searchMissNextPosition(SearchResult result)
    • findNextSiblingKeyOfLeafNode

      private void findNextSiblingKeyOfLeafNode()