Package org.neo4j.gds.core.utils.paged
Interface HugeCursorSupport<Array>
-
- All Known Implementing Classes:
HugeArray
,HugeAtomicByteArray
,HugeAtomicLongArray
,HugeByteArray
,HugeDoubleArray
,HugeIntArray
,HugeLongArray
,HugeObjectArray
public interface HugeCursorSupport<Array>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default HugeCursor<Array>
initCursor(HugeCursor<Array> cursor)
Resets theHugeCursor
to range from index 0 untilsize()
.default HugeCursor<Array>
initCursor(HugeCursor<Array> cursor, long start, long end)
Resets theHugeCursor
to range from indexstart
(inclusive, the first index to be contained) untilend
(exclusive, the first index not to be contained).HugeCursor<Array>
newCursor()
Returns a newHugeCursor
for this array.long
size()
Returns the length of this array.
-
-
-
Method Detail
-
size
long size()
Returns the length of this array.If the size is greater than zero, the highest supported index is
size() - 1
The behavior is identical to calling
array.length
on primitive arrays.
-
newCursor
HugeCursor<Array> newCursor()
Returns a newHugeCursor
for this array. The cursor is not positioned and in an invalid state. To position the cursor you must callinitCursor(HugeCursor)
orinitCursor(HugeCursor, long, long)
. Then the cursor needs to be put in a valid state by callingHugeCursor.next()
. Obtaining aHugeCursor
for an empty array (wheresize()
returns0
) is undefined and might result in aNullPointerException
or anotherRuntimeException
.
-
initCursor
default HugeCursor<Array> initCursor(HugeCursor<Array> cursor)
Resets theHugeCursor
to range from index 0 untilsize()
. The returned cursor is not positioned and in an invalid state. You must callHugeCursor.next()
first to position the cursor to a valid state. The returned cursor is the reference-same (==
) one as the provided one. Resetting theHugeCursor
of an empty array (wheresize()
returns0
) is undefined and might result in aNullPointerException
or anotherRuntimeException
.
-
initCursor
default HugeCursor<Array> initCursor(HugeCursor<Array> cursor, long start, long end)
Resets theHugeCursor
to range from indexstart
(inclusive, the first index to be contained) untilend
(exclusive, the first index not to be contained). The returned cursor is not positioned and in an invalid state. You must callHugeCursor.next()
first to position the cursor to a valid state. The returned cursor is the reference-same (==
) one as the provided one. Resetting theHugeCursor
of an empty array (wheresize()
returns0
) is undefined and might result in aNullPointerException
or anotherRuntimeException
.- See Also:
initCursor(HugeCursor)
-
-