Class CompositeAdjacencyCursor

  • All Implemented Interfaces:
    java.lang.AutoCloseable, AdjacencyCursor

    public class CompositeAdjacencyCursor
    extends java.lang.Object
    implements AdjacencyCursor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long advance​(long target)
      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.
      java.util.List<AdjacencyCursor> cursors()  
      boolean hasNextVLong()
      Return true iff there is at least one more target to decode.
      void init​(long index, int degree)
      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 target)
      Read and decode target ids until it is strictly larger than (>) the provided target.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompositeAdjacencyCursor

        public CompositeAdjacencyCursor​(java.util.List<AdjacencyCursor> cursors)
    • Method Detail

      • size

        public int size()
        Description copied from interface: AdjacencyCursor
        Return how many targets can be decoded in total. This is equivalent to the degree.
        Specified by:
        size in interface AdjacencyCursor
      • hasNextVLong

        public boolean hasNextVLong()
        Description copied from interface: AdjacencyCursor
        Return true iff there is at least one more target to decode.
        Specified by:
        hasNextVLong in interface AdjacencyCursor
      • remaining

        public int remaining()
        Description copied from interface: AdjacencyCursor
        Return how many targets are still left to be decoded.
        Specified by:
        remaining in interface AdjacencyCursor
      • close

        public void close()
        Specified by:
        close in interface AdjacencyCursor
        Specified by:
        close in interface java.lang.AutoCloseable
      • skipUntil

        public long skipUntil​(long target)
        Description copied from interface: AdjacencyCursor
        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 AdjacencyCursor.hasNextVLong() will return false
        Specified by:
        skipUntil in interface AdjacencyCursor
      • advance

        public long advance​(long target)
        Description copied from interface: AdjacencyCursor
        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 AdjacencyCursor.hasNextVLong() will return false
        Specified by:
        advance in interface AdjacencyCursor
      • copyFrom

        public void copyFrom​(AdjacencyCursor sourceCursor)
        Description copied from interface: AdjacencyCursor
        Copies internal states from sourceCursor into this cursor. If the types don't match, the behavior is undefined.
        Specified by:
        copyFrom in interface AdjacencyCursor
      • init

        public void init​(long index,
                         int degree)
        Description copied from interface: AdjacencyCursor
        Initialize this cursor to point to the given index.
        Specified by:
        init in interface AdjacencyCursor