Class UncompressedAdjacencyList.Cursor
- java.lang.Object
-
- org.neo4j.gds.core.loading.MutableIntValue
-
- org.neo4j.gds.core.compression.uncompressed.UncompressedAdjacencyList.Cursor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,AdjacencyCursor
,PropertyCursor
- Enclosing class:
- UncompressedAdjacencyList
public static final class UncompressedAdjacencyList.Cursor extends MutableIntValue implements AdjacencyCursor, PropertyCursor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.AdjacencyCursor
AdjacencyCursor.EmptyAdjacencyCursor
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.PropertyCursor
PropertyCursor.EmptyPropertyCursor
-
-
Field Summary
-
Fields inherited from class org.neo4j.gds.core.loading.MutableIntValue
value
-
Fields inherited from interface org.neo4j.gds.api.AdjacencyCursor
NOT_FOUND
-
-
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 providedtarget
.long
advanceBy(int n)
Advance this cursor byn
elements.void
close()
boolean
hasNextLong()
Return true iff there is at least one more target to decode.boolean
hasNextVLong()
Return true iff there is at least one more target to decode.void
init(long fromIndex, int degree)
Initialize this cursor to point to the givenindex
.long
nextLong()
Read the next target id.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.@NotNull AdjacencyCursor
shallowCopy(@Nullable AdjacencyCursor destination)
Create a shallow copy of this cursor.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 providedtarget
.
-
-
-
Method Detail
-
init
public void init(long fromIndex, int degree)
Description copied from interface:AdjacencyCursor
Initialize this cursor to point to the givenindex
. The correct value for the index is highly implementation specific. The better way get initialize a cursor is throughAdjacencyList.adjacencyCursor(long)
or related.- Specified by:
init
in interfaceAdjacencyCursor
- Specified by:
init
in interfacePropertyCursor
-
hasNextLong
public boolean hasNextLong()
Description copied from interface:PropertyCursor
Return true iff there is at least one more target to decode.- Specified by:
hasNextLong
in interfacePropertyCursor
-
nextLong
public long nextLong()
Description copied from interface:PropertyCursor
Read the next target id. It is undefined behavior if this is called afterPropertyCursor.hasNextLong()
returnsfalse
.- Specified by:
nextLong
in interfacePropertyCursor
-
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 interfaceAdjacencyCursor
-
remaining
public int remaining()
Description copied from interface:AdjacencyCursor
Return how many targets are still left to be decoded.- Specified by:
remaining
in interfaceAdjacencyCursor
-
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 interfaceAdjacencyCursor
-
nextVLong
public long nextVLong()
Description copied from interface:AdjacencyCursor
Read and decode the next target id. It is undefined behavior if this is called afterAdjacencyCursor.hasNextVLong()
returnsfalse
.- Specified by:
nextVLong
in interfaceAdjacencyCursor
-
peekVLong
public long peekVLong()
Description copied from interface:AdjacencyCursor
Decode and peek the next target id. Does not progress the internal cursor unlikeAdjacencyCursor.nextVLong()
. It is undefined behavior if this is called afterAdjacencyCursor.hasNextVLong()
returnsfalse
.- Specified by:
peekVLong
in interfaceAdjacencyCursor
-
shallowCopy
@NotNull public @NotNull AdjacencyCursor shallowCopy(@Nullable @Nullable AdjacencyCursor destination)
Description copied from interface:AdjacencyCursor
Create a shallow copy of this cursor. Iteration state is copied and will advance independently from this cursor. The underlying data might be shared between instances. If the provideddestination
argument is not null, it might be re-used instead of having to create a new instance. It is *not* guaranteed that thedestination
will be reused. If thedestination
is not if the same type than this cursor, the behavior of this method in undefined.- Specified by:
shallowCopy
in interfaceAdjacencyCursor
-
skipUntil
public long skipUntil(long target)
Description copied from interface:AdjacencyCursor
Read and decode target ids until it is strictly larger than (>) the providedtarget
. If there are no such targets before this cursor is exhausted,-1
is returned.- Specified by:
skipUntil
in interfaceAdjacencyCursor
-
advance
public long advance(long target)
Description copied from interface:AdjacencyCursor
Read and decode target ids until it is larger than or equal (>=) the providedtarget
. If there are no such targets before this cursor is exhausted,-1
is returned.- Specified by:
advance
in interfaceAdjacencyCursor
-
advanceBy
public long advanceBy(int n)
Description copied from interface:AdjacencyCursor
Advance this cursor byn
elements. For a cursor in its initial position, this is equivalent tonth
.- Specified by:
advanceBy
in interfaceAdjacencyCursor
- Parameters:
n
- the number of elements to advance by. Must be positive.- Returns:
- the target after the advancement or
-1
if the cursor is exhausted.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacePropertyCursor
-
-