|
AlgART Home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.algart.arrays.AbstractArray
net.algart.arrays.AbstractDoubleArray
public abstract class AbstractDoubleArray extends AbstractArray implements DoubleArray
Implementation of almost all basic functions of DoubleArray interface.
The only DoubleArray.getDouble(long) method is not defined in this class;
all other methods are implemented via calls of DoubleArray.getDouble(long).
AlgART Laboratory 2007-2013
| Modifier and Type | Field and Description |
|---|
| Fields inherited from class net.algart.arrays.AbstractArray |
|---|
capacity, length, underlyingArrays |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDoubleArray(long initialCapacityAndLength,
boolean underlyingArraysAreParallel,
Array... underlyingArrays)
Equivalent to the constructor AbstractDoubleArray(long, long, boolean, Array...),
where both initialCapacity and initialLength arguments are equal to
initialCapacityAndLength. |
protected |
AbstractDoubleArray(long initialCapacity,
long initialLength,
boolean underlyingArraysAreParallel,
Array... underlyingArrays)
Creates an array with the given initial capacity and length. |
| Modifier and Type | Method and Description |
|---|---|
Array |
asCopyOnNextWrite()
This implementation returns this object. |
DoubleArray |
asImmutable()
This implementation returns this object. |
DoubleArray |
asTrustedImmutable()
This implementation calls asImmutable() and returns its result. |
long |
bitsPerElement()
Return the number of memory bits occupied by every element of this array. |
DataDoubleBuffer |
buffer()
This implementation returns buffer(suitableMode), where suitableMode is
this instanceof UpdatableArray ?
DataBuffer.AccessMode.READ_WRITE :
DataBuffer.AccessMode.READ. |
DataDoubleBuffer |
buffer(DataBuffer.AccessMode mode)
This implementation returns buffer(mode, someCapacity), where mode is the argument of this method
and someCapacity is the result of defaultBufferCapacity(thisArray) method. |
DataDoubleBuffer |
buffer(DataBuffer.AccessMode mode,
long capacity)
This method is fully implemented in this class. |
DataDoubleBuffer |
buffer(long capacity)
This implementation returns buffer(suitableMode, capacity), where capacity is the argument of this method
and suitableMode is
this instanceof UpdatableArray ?
DataBuffer.AccessMode.READ_WRITE :
DataBuffer.AccessMode.READ. |
void |
checkUnallowedMutation()
This implementation does nothing. |
java.lang.Class<?> |
elementType()
Returns the type of array elements. |
void |
flushResources(ArrayContext context,
boolean forcePhysicalWriting)
This implementation calls flushResources(context, 0, length(), forcePhysicalWriting). |
protected void |
flushResources(ArrayContext context,
long fromIndex,
long toIndex,
boolean forcePhysicalWriting)
This method implements all actions that should be performed by subArray(fromIndex, toIndex).flushResources(context, forcePhysicalWriting) |
void |
freeResources(ArrayContext context,
boolean forcePhysicalWriting)
This implementation calls freeResources(context, 0, length()), forcePhysicalWriting). |
protected void |
freeResources(ArrayContext context,
long fromIndex,
long toIndex,
boolean forcePhysicalWriting)
This method implements all actions that should be performed by subArray(fromIndex, toIndex).freeResources(context, forcePhysicalWriting) |
void |
getData(long arrayPos,
java.lang.Object destArray)
This implementation calls getData(long, Object, int, int)
with corresponding arguments. |
void |
getData(long arrayPos,
java.lang.Object destArray,
int destArrayOffset,
int count)
This implementation is based on a loop of calls of getDouble(long) method. |
abstract double |
getDouble(long index)
Returns the element #index. |
java.lang.Object |
getElement(long index)
This implementation returns getDouble(index). |
long |
indexOf(long lowIndex,
long highIndex,
double value)
This implementation is based on a loop of calls of getDouble(long) method
from index max(lowIndex,0) until index min(AbstractArray.length(),highIndex)-1. |
boolean |
isCopyOnNextWrite()
This implementation returns false. |
boolean |
isImmutable()
This implementation returns true. |
boolean |
isUnresizable()
This implementation returns true. |
long |
lastIndexOf(long lowIndex,
long highIndex,
double value)
This implementation is based on a loop of calls of getDouble(long) method
from index min(AbstractArray.length(),highIndex)-1 back until index max(lowIndex,0). |
void |
loadResources(ArrayContext context)
This implementation calls loadResources(context, 0, length()). |
protected void |
loadResources(ArrayContext context,
long fromIndex,
long toIndex)
This method implements all actions that should be performed by subArray(fromIndex, toIndex).loadResources(context) |
double |
maxPossibleValue(double valueForFloatingPoint)
Returns 1 for BitArray,
0xFF for ByteArray,
0xFFFF for CharArray and ShortArray,
Integer.MAX_VALUE for IntArray,
Long.MAX_VALUE for LongArray,
valueForFloatingPoint for FloatArray and DoubleArray. |
double |
minPossibleValue(double valueForFloatingPoint)
Returns 0 for BitArray, ByteArray, CharArray and ShortArray,
Integer.MIN_VALUE for IntArray,
Long.MIN_VALUE for LongArray,
valueForFloatingPoint for FloatArray and DoubleArray. |
MutableDoubleArray |
mutableClone(MemoryModel memoryModel)
This implementation performs the following: memoryModel. newArray(thisArray).copy(thisArray). |
java.lang.Class<? extends MutableDoubleArray> |
mutableType()
Returns the canonical resizable AlgART type of arrays with the same element types: the class of one of 9 basic interfaces, describing all kinds of resizable AlgART arrays for 8 primitive and any non-primitive element types. |
Array |
subArray(long fromIndex,
long toIndex)
This implementation returns new instance of AbstractDoubleArray with the same memory model,
underlying arrays and underlyingArraysAreParallel flag, that were passed
to the constructor of this instance,
and with overridden methods getDouble(long) and
getData(long, Object, int, int),
calling the same methods of this instance with corresponding corrections of the arguments. |
java.lang.String |
toString()
Returns a brief string description of this object. |
java.lang.Class<? extends DoubleArray> |
type()
Returns the canonical AlgART type of this array: the class of one of 9 basic interfaces, describing all kinds of AlgART arrays for 8 primitive and any non-primitive element types. |
UpdatableDoubleArray |
updatableClone(MemoryModel memoryModel)
This implementation performs the following: memoryModel. newUnresizableArray(thisArray).copy(thisArray). |
java.lang.Class<? extends UpdatableDoubleArray> |
updatableType()
Returns the canonical updatable AlgART type of arrays with the same element types: the class of one of 9 basic interfaces, describing all kinds of updatable AlgART arrays for 8 primitive and any non-primitive element types. |
| Methods inherited from class net.algart.arrays.AbstractArray |
|---|
byteOrder, capacity, checkCopyArguments, checkSubArrArguments, checkSubArrayArguments, checkSwapArguments, defaultAppend, defaultBuffer, defaultBufferCapacity, defaultCopy, defaultCopy, defaultSwap, equals, equals, flushResources, freeResources, hashCode, hashCode, isLazy, isNew, isNewReadOnlyView, isZeroFilled, length, newJavaArray, setNewReadOnlyViewStatus, setNewStatus, shallowClone, standardObjectClone, subArr |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.algart.arrays.PArray |
|---|
isZeroFilled |
| Methods inherited from interface net.algart.arrays.Array |
|---|
byteOrder, capacity, equals, flushResources, freeResources, hashCode, isLazy, isNew, isNewReadOnlyView, length, newJavaArray, shallowClone, subArr |
| Constructor Detail |
|---|
protected AbstractDoubleArray(long initialCapacity,
long initialLength,
boolean underlyingArraysAreParallel,
Array... underlyingArrays)
The underlyingArraysAreParallel informs whether the passed underlying arrays (if they exist) are "parallel" to this one and to each other. Intuitively, it means that every element #k of this array is connected (for example, depends on) the elements #k (of, maybe, #k±i, where i is little) of the underlying arrays. Precisely, this argument affects the following in this implementation:
SizeMismatchException.
loadResources(ArrayContext context, long fromIndex, long toIndex),flushResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
andfreeResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
loadResources(ArrayContext context),
flushResources(ArrayContext context, boolean forcePhysicalWriting) and
freeResources(ArrayContext context, boolean forcePhysicalWriting)
methods for the corresponding subarrays of all underlying
arrays. If this argument is false, thenloadResources(ArrayContext context, long fromIndex, long toIndex) does nothing,flushResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
and freeResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
methods ignore their fromIndex / toIndex arguments and call
loadResources(ArrayContext context),
flushResources(ArrayContext context, boolean forcePhysicalWriting) and
freeResources(ArrayContext context, boolean forcePhysicalWriting)
methods for original underlying arrays (not their subarrays).loadResources(ArrayContext context, long fromIndex, long toIndex),
flushResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
and freeResources(ArrayContext context, long fromIndex, long toIndex, boolean forcePhysicalWriting)
methods and offer better implementations for subarrays,
for example, that will work with suitable regions of the underlying arrays.
The created array is not new by default.
This is correct usually, because this class is often used
for creating a view of another data. However, if the instance
if this class does not depend on any other data sources,
you may call setNewStatus(true) in
the constructor of your subclass.
The created array never has new-read-only-view status:
Array.isNewReadOnlyView() method always returns false in this class and its inheritors.
initialCapacity - initial capacity of the array.initialLength - initial length of the array.underlyingArraysAreParallel - whether the underlying arrays are "parallel" to this.underlyingArrays - see the same argument of
AbstractArray.AbstractArray(long, long, Array...).java.lang.NullPointerException - if underlyingArrays argument or some of underlyingArrays[k]
elements is null.java.lang.IllegalArgumentException - if the initialCapacity or initialLength arguments
are illegal (negative, or capacity < length).SizeMismatchException - if underlyingArraysAreParallel=true,
underlyingArrays.length>1 and some of passed arrays
have different lengths.
protected AbstractDoubleArray(long initialCapacityAndLength,
boolean underlyingArraysAreParallel,
Array... underlyingArrays)
AbstractDoubleArray(long, long, boolean, Array...),
where both initialCapacity and initialLength arguments are equal to
initialCapacityAndLength.
initialCapacityAndLength - initial capacity and length of the array.underlyingArraysAreParallel - see AbstractDoubleArray(long, long, boolean, Array...).underlyingArrays - see AbstractDoubleArray(long, long, boolean, Array...).java.lang.NullPointerException - if underlyingArrays argument or some of underlyingArrays[k]
elements is null.java.lang.IllegalArgumentException - if initialCapacityAndLength argument is negative.SizeMismatchException - if underlyingArraysAreParallel=true,
underlyingArrays.length>1 and some of passed arrays
have different lengths.| Method Detail |
|---|
public java.lang.Class<?> elementType()
ArrayBitArray,CharArray,ByteArray,ShortArray,IntArray),LongArray,FloatArray,DoubleArray.There is a guarantee that this method works very quickly (usually it just returns a value of some private field).
elementType in interface ArrayelementType in class AbstractArrayArrays.elementType(Class)public java.lang.Class<? extends DoubleArray> type()
ArrayBitArray.class, if this object is an instance of BitArray,CharArray.class, if this object is an instance of CharArray,ByteArray.class, if this object is an instance of ByteArray,ShortArray.class, if this object is an instance of ShortArray,IntArray.class, if this object is an instance of IntArray,LongArray.class, if this object is an instance of LongArray,FloatArray.class, if this object is an instance of FloatArray,DoubleArray.class, if this object is an instance of DoubleArray,ObjectArray.class, if this object is an instance of ObjectArray.There is a guarantee that this method works very quickly (usually it just returns a constant value).
type in interface Arraytype in interface DoubleArraytype in interface PArraytype in interface PFloatingArraytype in interface PNumberArraytype in class AbstractArraypublic java.lang.Class<? extends UpdatableDoubleArray> updatableType()
ArrayUpdatableBitArray.class, if this object is an instance of BitArray,UpdatableCharArray.class, if this object is an instance of CharArray,UpdatableByteArray.class, if this object is an instance of ByteArray,UpdatableShortArray.class, if this object is an instance of ShortArray,UpdatableIntArray.class, if this object is an instance of IntArray,UpdatableLongArray.class, if this object is an instance of LongArray,UpdatableFloatArray.class, if this object is an instance of FloatArray,UpdatableDoubleArray.class, if this object is an instance of DoubleArray,UpdatableObjectArray.class, if this object is an instance of ObjectArray.There is a guarantee that this method works very quickly (usually it just returns a constant value).
updatableType in interface ArrayupdatableType in interface DoubleArrayupdatableType in interface PArrayupdatableType in interface PFloatingArrayupdatableType in interface PNumberArrayupdatableType in class AbstractArraypublic java.lang.Class<? extends MutableDoubleArray> mutableType()
ArrayMutableBitArray.class, if this object is an instance of BitArray,MutableCharArray.class, if this object is an instance of CharArray,MutableByteArray.class, if this object is an instance of ByteArray,MutableShortArray.class, if this object is an instance of ShortArray,MutableIntArray.class, if this object is an instance of IntArray,MutableLongArray.class, if this object is an instance of LongArray,MutableFloatArray.class, if this object is an instance of FloatArray,MutableDoubleArray.class, if this object is an instance of DoubleArray,MutableObjectArray.class, if this object is an instance of ObjectArray.There is a guarantee that this method works very quickly (usually it just returns a constant value).
mutableType in interface ArraymutableType in interface DoubleArraymutableType in interface PArraymutableType in interface PFloatingArraymutableType in interface PNumberArraymutableType in class AbstractArray
public void getData(long arrayPos,
java.lang.Object destArray,
int destArrayOffset,
int count)
getDouble(long) method.
Please override this method if it's possible to perform the same task more efficiently
than such a loop.
getData in interface ArraygetData in class AbstractArrayarrayPos - starting position in this AlgART array.destArray - the target Java array.destArrayOffset - starting position in the target Java array.count - the number of elements to be copied.java.lang.NullPointerException - if destArray argument is null.java.lang.IllegalArgumentException - if destArray argument is not an array.java.lang.IndexOutOfBoundsException - if copying would cause access of data outside this array or target array.java.lang.ArrayStoreException - if destArray element type mismatches with this array
elementType().java.lang.ClassCastException - if destArray element type mismatches with this array
elementType()
(both this and ArrayStoreException are possible,
depending on implementation).DirectAccessible,
UpdatableArray.setData(long, Object, int, int),
BitArray.getBits(long, long[], long, long)
public void getData(long arrayPos,
java.lang.Object destArray)
getData(long, Object, int, int)
with corresponding arguments.
getData in interface ArraygetData in class AbstractArrayarrayPos - starting position in this AlgART array.destArray - the target Java array.java.lang.NullPointerException - if destArray argument is null.java.lang.IllegalArgumentException - if destArray argument is not an array.java.lang.IndexOutOfBoundsException - if arrayPos is out of range 0..length()-1.java.lang.ArrayStoreException - if destArray element type mismatches with this array
elementType().java.lang.ClassCastException - if destArray element type mismatches with this array
elementType()
(both this and ArrayStoreException are possible,
depending on implementation).DirectAccessible,
Array.getData(long, Object, int, int),
UpdatableArray.setData(long, Object)public java.lang.Object getElement(long index)
getElement in interface ArraygetElement in class AbstractArrayindex - index of element to get.java.lang.IndexOutOfBoundsException - if index is out of range 0..length()-1.
public Array subArray(long fromIndex,
long toIndex)
AbstractDoubleArray with the same memory model,
underlying arrays and underlyingArraysAreParallel flag, that were passed
to the constructor of this instance,
and with overridden methods getDouble(long) and
getData(long, Object, int, int),
calling the same methods of this instance with corresponding corrections of the arguments.
The returned instance also have overridden methods loadResources(ArrayContext, long, long),
flushResources(ArrayContext, long, long, boolean) and
freeResources(ArrayContext, long, long, boolean),
that also call the same methods of this instance with corresponding correction of their fromIndex
argument.
The returned instance also have overridden method AbstractArray.isLazy(),
that just calls the same methods of this instance with the same arguments.
subArray in interface ArraysubArray in class AbstractArrayfromIndex - low endpoint (inclusive) of the subarray.toIndex - high endpoint (exclusive) of the subarray.java.lang.IndexOutOfBoundsException - for illegal fromIndex and toIndex
(fromIndex < 0 || toIndex > length() || fromIndex > toIndex).Array.subArr(long, long)
public DataDoubleBuffer buffer(DataBuffer.AccessMode mode,
long capacity)
AbstractArrayThe returned buffer will be direct,
if mode is not PRIVATE,
this array is not immutable,
is not copy-on-next-write,
and either it implements DirectAccessible interface and
its hasJavaArray() method returns true,
or it is a bit array created by the simple memory model.
buffer in interface Arraybuffer in interface DoubleArraybuffer in class AbstractArraymode - the access mode for new buffer.capacity - the capacity of the bufferArray.buffer(net.algart.arrays.DataBuffer.AccessMode),
Array.buffer(long),
Array.buffer()public DataDoubleBuffer buffer(DataBuffer.AccessMode mode)
AbstractArraybuffer(mode, someCapacity), where mode is the argument of this method
and someCapacity is the result of defaultBufferCapacity(thisArray) method.
buffer in interface Arraybuffer in interface DoubleArraybuffer in class AbstractArraymode - the access mode for new buffer.public DataDoubleBuffer buffer(long capacity)
AbstractArraybuffer(suitableMode, capacity), where capacity is the argument of this method
and suitableMode is
this instanceof UpdatableArray ?
DataBuffer.AccessMode.READ_WRITE :
DataBuffer.AccessMode.READ.
buffer in interface Arraybuffer in interface DoubleArraybuffer in class AbstractArraycapacity - the capacity of the buffer.public DataDoubleBuffer buffer()
AbstractArraybuffer(suitableMode), where suitableMode is
this instanceof UpdatableArray ?
DataBuffer.AccessMode.READ_WRITE :
DataBuffer.AccessMode.READ.
buffer in interface Arraybuffer in interface DoubleArraybuffer in class AbstractArraypublic long bitsPerElement()
PArrayArray.capacity()*bitsPerElement()/8 bytes
(when the array capacity is large enough).
If the number of occupied bits is not defined (for example, may depend on JVM implementation), this method returns -1.
For implementations from this package, this method returns:
BitArray (the value of Arrays.BITS_PER_BIT constant),CharArray (the value of Arrays.BITS_PER_CHAR constant),ByteArray (the value of Arrays.BITS_PER_BYTE constant),ShortArray (the value of Arrays.BITS_PER_SHORT constant),IntArray (the value of Arrays.BITS_PER_INT constant),LongArray (the value of Arrays.BITS_PER_LONG constant),FloatArray (the value of Arrays.BITS_PER_FLOAT constant),DoubleArray (the value of Arrays.BITS_PER_DOUBLE constant).(-1 result is never returned by implementations from this package.)
Please keep in mind that the real amount of occupied memory, theoretically, can differ
from the value returned by this method.
For example, some JVM, theoretically, may store byte elements of byte[] array
in 32-bit memory words. In this case, this method will return invalid result for byte arrays
created by the simple memory model.
However: we guarantee the results of this method are always correct for arrays created
by the buffer memory model and large memory model.
There is a guarantee that this method works very quickly (usually it just returns a constant or a value of some private field).
bitsPerElement in interface PArrayArrays.bitsPerElement(Class)public abstract double getDouble(long index)
DoubleArray
getDouble in interface DoubleArraygetDouble in interface PArrayindex - index of element to get.UpdatablePArray.setDouble(long, double)
public long indexOf(long lowIndex,
long highIndex,
double value)
getDouble(long) method
from index max(lowIndex,0) until index min(AbstractArray.length(),highIndex)-1.
Please override this method if it's possible to perform the same task more efficiently
than such a loop.
indexOf in interface DoubleArrayindexOf in interface PArraylowIndex - the low index in the array for search (inclusive).highIndex - the high index in the array for search (exclusive).value - the value to be found.
public long lastIndexOf(long lowIndex,
long highIndex,
double value)
getDouble(long) method
from index min(AbstractArray.length(),highIndex)-1 back until index max(lowIndex,0).
Please override this method if it's possible to perform the same task more efficiently
than such a loop.
lastIndexOf in interface DoubleArraylastIndexOf in interface PArraylowIndex - the low index in the array for search (inclusive).highIndex - the high index in the array for search (exclusive).value - the value to be found.public boolean isImmutable()
isImmutable in interface ArrayisImmutable in class AbstractArrayArray.asImmutable()public boolean isUnresizable()
isUnresizable in interface ArrayisUnresizable in class AbstractArrayUpdatableArray.asUnresizable()
public void checkUnallowedMutation()
throws UnallowedMutationError
checkUnallowedMutation in interface ArraycheckUnallowedMutation in class AbstractArrayUnallowedMutationError - never in this implementation.Array.asTrustedImmutable()public DoubleArray asTrustedImmutable()
asImmutable() and returns its result.
asTrustedImmutable in interface ArrayasTrustedImmutable in interface DoubleArrayasTrustedImmutable in interface PArrayasTrustedImmutable in interface PFloatingArrayasTrustedImmutable in class AbstractArrayArray.asImmutable(),
Array.checkUnallowedMutation()public Array asCopyOnNextWrite()
asCopyOnNextWrite in interface ArrayasCopyOnNextWrite in class AbstractArrayArray.isCopyOnNextWrite(),
MemoryModel.newLazyCopy(Array),
MemoryModel.newUnresizableLazyCopy(Array)public boolean isCopyOnNextWrite()
isCopyOnNextWrite in interface ArrayisCopyOnNextWrite in class AbstractArrayArray.asCopyOnNextWrite()public DoubleArray asImmutable()
asImmutable in interface ArrayasImmutable in interface DoubleArrayasImmutable in interface PArrayasImmutable in interface PFloatingArrayasImmutable in class AbstractArrayArray.isImmutable(),
Array.asTrustedImmutable(),
Array.mutableClone(MemoryModel),
Array.updatableClone(MemoryModel),
UpdatableArray.asUnresizable()public MutableDoubleArray mutableClone(MemoryModel memoryModel)
AbstractArraynewArray(thisArray).copy(thisArray).
mutableClone in interface ArraymutableClone in interface DoubleArraymutableClone in interface PArraymutableClone in interface PFloatingArraymutableClone in class AbstractArraymemoryModel - the memory model, used for allocation a new copy of this array.Array.updatableClone(MemoryModel)public UpdatableDoubleArray updatableClone(MemoryModel memoryModel)
AbstractArraynewUnresizableArray(thisArray).copy(thisArray).
updatableClone in interface ArrayupdatableClone in interface DoubleArrayupdatableClone in interface PArrayupdatableClone in interface PFloatingArrayupdatableClone in class AbstractArraymemoryModel - the memory model, used for allocation a new copy of this array.Array.mutableClone(MemoryModel)public void loadResources(ArrayContext context)
loadResources(context, 0, length()).
loadResources in interface ArrayloadResources in class AbstractArraycontext - the context of execution; may be null, then it will be ignored.Array.freeResources(ArrayContext),
Array.flushResources(ArrayContext),
Array.flushResources(ArrayContext, boolean)
public void flushResources(ArrayContext context,
boolean forcePhysicalWriting)
flushResources(context, 0, length(), forcePhysicalWriting).
flushResources in interface ArrayflushResources in class AbstractArraycontext - the context of execution; may be null, then it will be ignored.forcePhysicalWriting - is it necessary to try forcing physical writing all associated resources
to the external device.Array.loadResources(ArrayContext),
Array.flushResources(ArrayContext),
Array.freeResources(ArrayContext, boolean)
public void freeResources(ArrayContext context,
boolean forcePhysicalWriting)
freeResources(context, 0, length()), forcePhysicalWriting).
freeResources in interface ArrayfreeResources in class AbstractArraycontext - the context of execution; may be null, then it will be ignored.forcePhysicalWriting - is it necessary to try forcing physical writing all associated resources
to the external device.Array.loadResources(ArrayContext context),
Array.flushResources(ArrayContext context, boolean forcePhysicalWriting),
Array.freeResources(ArrayContext),
Arrays.freeAllResources()
protected void loadResources(ArrayContext context,
long fromIndex,
long toIndex)
subArray(fromIndex, toIndex).loadResources(context)loadResources(c)
(where c is a necessary part of the passed context)
for the corresponding subarray
of all underlying arrays, passed via the last argument of the constructor,
if the underlyingArraysAreParallel constructor argument was true,
or does nothing in other case.
context - the context of execution; may be null, then it will be ignored.fromIndex - low endpoint (inclusive) of the subarray that should be loaded.toIndex - high endpoint (exclusive) of the subarray that should be loaded.java.lang.IndexOutOfBoundsException - for illegal fromIndex and toIndex
(fromIndex < 0 || toIndex > length() || fromIndex > toIndex).
protected void flushResources(ArrayContext context,
long fromIndex,
long toIndex,
boolean forcePhysicalWriting)
subArray(fromIndex, toIndex).flushResources(context, forcePhysicalWriting)flushResources(c, forcePhysicalWriting)
(where c is a necessary part of the passed context)
for the corresponding subarray of all underlying arrays, passed via the last argument of the constructor,
if the underlyingArraysAreParallel constructor argument was true,
or for original underlying arrays in other case
(alike AbstractArray.flushResources(ArrayContext, boolean)).
context - the context of execution; may be null, then it will be ignored.fromIndex - low endpoint (inclusive) of the subarray that should be flushed.toIndex - high endpoint (exclusive) of the subarray that should be flushed.forcePhysicalWriting - is it necessary to try forcing physical writing all associated resources
to the external device.java.lang.IndexOutOfBoundsException - for illegal fromIndex and toIndex
(fromIndex < 0 || toIndex > length() || fromIndex > toIndex).
protected void freeResources(ArrayContext context,
long fromIndex,
long toIndex,
boolean forcePhysicalWriting)
subArray(fromIndex, toIndex).freeResources(context, forcePhysicalWriting)freeResources(c, forcePhysicalWriting)
(where c is a necessary part of the passed context)
for the corresponding subarray of all underlying arrays, passed via the last argument of the constructor,
if the underlyingArraysAreParallel constructor argument was true,
or for original underlying arrays in other case
(alike AbstractArray.freeResources(ArrayContext, boolean)).
context - the context of execution; may be null, then it will be ignored.fromIndex - low endpoint (inclusive) of the subarray that should be freed.toIndex - high endpoint (exclusive) of the subarray that should be freed.forcePhysicalWriting - is it necessary to try forcing physical writing all associated resources
to the external device.java.lang.IndexOutOfBoundsException - for illegal fromIndex and toIndex
(fromIndex < 0 || toIndex > length() || fromIndex > toIndex).public java.lang.String toString()
ArrayThe result of this method may depend on implementation and usually contains a short description of the array length, capacity, element type.
Note: for character arrays, unlike CharSequence.toString(),
this method works as for all other array types.
If you need to convert a character array to a string,
containing all characters of the array, you may use
Arrays.toString(CharArray) method.
toString in interface ArraytoString in class AbstractArraypublic double minPossibleValue(double valueForFloatingPoint)
PArrayBitArray, ByteArray, CharArray and ShortArray,
Integer.MIN_VALUE for IntArray,
Long.MIN_VALUE for LongArray,
valueForFloatingPoint for FloatArray and DoubleArray.
For fixed-point arrays it is the minimal possible value,
that can stored in elements of this array
(byte and short elements are interpreted as unsigned).
This method is equivalent to
minPossibleValue(thisArray.getClass(),
valueForFloatingPoint).
minPossibleValue in interface PArrayvalueForFloatingPoint - the value returned for floating-point array type.PFixedArray.minPossibleValue()public double maxPossibleValue(double valueForFloatingPoint)
PArrayBitArray,
0xFF for ByteArray,
0xFFFF for CharArray and ShortArray,
Integer.MAX_VALUE for IntArray,
Long.MAX_VALUE for LongArray,
valueForFloatingPoint for FloatArray and DoubleArray.
For fixed-point arrays it is the maximal possible value,
that can stored in elements of this array
(byte and short elements are interpreted as unsigned).
This method is equivalent to
maxPossibleValue(thisArray.getClass(),
valueForFloatingPoint).
maxPossibleValue in interface PArrayvalueForFloatingPoint - the value returned for floating-point array type.PFixedArray.maxPossibleValue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||