Package dev.vortex.jni
Class JNIArrayIterator
java.lang.Object
dev.vortex.jni.JNIArrayIterator
- All Implemented Interfaces:
ArrayIterator,AutoCloseable,Iterator<Array>
-
Constructor Details
-
JNIArrayIterator
public JNIArrayIterator(long pointer)
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
getDataType
Description copied from interface:ArrayIteratorReturns the data type of the arrays that this iterator produces.This method provides type information about the arrays that will be returned by subsequent calls to
Iterator.next(). The data type remains constant throughout the lifetime of the iterator and can be used for type-safe processing and validation.- Specified by:
getDataTypein interfaceArrayIterator- Returns:
- the
DTyperepresenting the data type of arrays produced by this iterator
-
close
public void close()Description copied from interface:ArrayIteratorCloses this iterator and releases any underlying resources.This method should be called when the iterator is no longer needed to ensure proper cleanup of any native resources or memory allocations. After calling this method, the iterator should not be used for further operations.
It is recommended to use this iterator within a try-with-resources statement to ensure automatic cleanup:
try (ArrayIterator iterator = array.getIterator()) { // Use iterator } // close() is called automaticallyThis method overrides
AutoCloseable.close()and does not throw any checked exceptions, making it safe to use in any context.- Specified by:
closein interfaceArrayIterator- Specified by:
closein interfaceAutoCloseable- See Also:
-