Class HugeCursor<Array>
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.paged.HugeCursor<Array>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public abstract class HugeCursor<Array> extends java.lang.Object implements java.lang.AutoCloseable
View of data underlying an Huge array, accessible as slices of one or more primitive arrays. The values are fromarray[offset]
(inclusive) untilarray[limit]
(exclusive). The range might match the complete array, but that isn't guaranteed.The
limit
parameter does not have the same meaning as thelength
parameter that is used in many methods that can operate on array slices. The proper value would beint length = limit - offset
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
close()
Releases the reference to the underlying array so that it might be garbage collected.abstract boolean
next()
Try to load the next page and return the success of this load.
-
-
-
Field Detail
-
base
public long base
the base for the index to get the global index
-
array
public Array array
a slice of values currently being traversed
-
offset
public int offset
the offset into the array
-
limit
public int limit
the limit of the array, exclusive – the first index not to be contained
-
-
Method Detail
-
next
public abstract boolean next()
Try to load the next page and return the success of this load. Once the method returnsfalse
, this method will never returntrue
again until the cursor is reset. The cursor behavior is not defined and might be unusable and throw exceptions after this method returnsfalse
.- Returns:
- true, iff the cursor is still valid on contains new data; false if there is no more data.
-
close
public abstract void close()
Releases the reference to the underlying array so that it might be garbage collected. The cursor can never be used again after calling this method, doing so results in undefined behavior.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-