Interface AdjacencyCursor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long NOT_FOUND  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      long advance​(long nodeId)
      Read and decode target ids until it is larger than or equal (>=) the provided target.
      void close()  
      void copyFrom​(AdjacencyCursor sourceCursor)
      Copies internal states from sourceCursor into this cursor.
      boolean hasNextVLong()
      Return true iff there is at least one more target to decode.
      void init​(long index)
      Initialize this cursor to point to the given index.
      default AdjacencyCursor initializedTo​(long index)
      Initialize this cursor to point to the given index.
      long nextVLong()
      Read and decode the next target id.
      long peekVLong()
      Decode and peek the next target id.
      int remaining()
      Return how many targets are still left to be decoded.
      int size()
      Return how many targets can be decoded in total.
      long skipUntil​(long nodeId)
      Read and decode target ids until it is strictly larger than (>) the provided target.
    • Method Detail

      • init

        void init​(long index)
        Initialize this cursor to point to the given index.
      • initializedTo

        default AdjacencyCursor initializedTo​(long index)
        Initialize this cursor to point to the given index. Returns this to allow chaining.
      • size

        int size()
        Return how many targets can be decoded in total. This is equivalent to the degree.
      • hasNextVLong

        boolean hasNextVLong()
        Return true iff there is at least one more target to decode.
      • nextVLong

        long nextVLong()
        Read and decode the next target id. It is undefined behavior if this is called after hasNextVLong() returns false.
      • peekVLong

        long peekVLong()
        Decode and peek the next target id. Does not progress the internal cursor unlike nextVLong().
      • remaining

        int remaining()
        Return how many targets are still left to be decoded.
      • skipUntil

        long skipUntil​(long nodeId)
        Read and decode target ids until it is strictly larger than (>) the provided target. Might return an id that is less than or equal to target iff the cursor did exhaust before finding an id that is large enough. skipUntil(target) <= target can be used to distinguish the no-more-ids case and afterwards hasNextVLong() will return false
      • advance

        long advance​(long nodeId)
        Read and decode target ids until it is larger than or equal (>=) the provided target. Might return an id that is less than target iff the cursor did exhaust before finding an id that is large enough. advance(target) < target can be used to distinguish the no-more-ids case and afterwards hasNextVLong() will return false
      • copyFrom

        void copyFrom​(AdjacencyCursor sourceCursor)
        Copies internal states from sourceCursor into this cursor. If the types don't match, the behavior is undefined.
      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable