Package org.apfloat.internal
Class LongMemoryArrayAccess
java.lang.Object
org.apfloat.spi.ArrayAccess
org.apfloat.internal.LongMemoryArrayAccess
- All Implemented Interfaces:
Serializable,AutoCloseable
Array access class based on a
long[].- Version:
- 1.6.3
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLongMemoryArrayAccess(long[] data, int offset, int length) Create an array access. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this array access and commit any changes to the underlying data storage if applicable.getData()Returns the array of this array access.long[]Returns the array of this array access as along[].subsequence(int offset, int length) Create a sub-sequence view of this array access.Methods inherited from class org.apfloat.spi.ArrayAccess
getDoubleData, getFloatData, getIntData, getLength, getOffset
-
Constructor Details
-
LongMemoryArrayAccess
public LongMemoryArrayAccess(long[] data, int offset, int length) Create an array access.- Parameters:
data- The underlying array.offset- The offset of the access segment within the array.length- The access segment.
-
-
Method Details
-
subsequence
Description copied from class:ArrayAccessCreate a sub-sequence view of this array access.Note that the changes done to the sub-sequence array are not necessarily committed to the underlying data storage when the sub-sequence is closed (with
ArrayAccess.close()), but only when the "base"ArrayAccessis closed.- Specified by:
subsequencein classArrayAccess- Parameters:
offset- The sub-sequence starting offset within this ArrayAccess.length- The sub-sequence length.- Returns:
- The sub-sequence array access.
-
getData
Description copied from class:ArrayAccessReturns the array of this array access. This is an array of a primitive type, depending on the implementation class.- Specified by:
getDatain classArrayAccess- Returns:
- The backing array of this array access.
-
getLongData
public long[] getLongData()Description copied from class:ArrayAccessReturns the array of this array access as along[].- Overrides:
getLongDatain classArrayAccess- Returns:
- The backing array of this array access.
-
close
Description copied from class:ArrayAccessClose this array access and commit any changes to the underlying data storage if applicable.If the
ArrayAccesswas obtained in write mode, the changes are saved to the data storage. Note that even if theArrayAccesswas obtained for reading only, any changes made to the array data may still be committed to the data storage.Note that changes done to a sub-sequence array are not necessarily committed to the underlying data storage when the sub-sequence is closed, but only when the "base"
ArrayAccessis closed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classArrayAccess- Throws:
ApfloatRuntimeException
-