Class AbstractMemoryModel
- All Implemented Interfaces:
- MemoryModel
- Direct Known Subclasses:
- BufferMemoryModel,- CombinedMemoryModel,- LargeMemoryModel,- SignalMemoryModel,- SimpleMemoryModel
A skeletal implementation of the MemoryModel interface to minimize
 the effort required to implement this interface.
This class implements all concrete newEmptyXxxArray, newXxxArray and newUnresizableXxxArray methods, and also all valueOf methods via trivial calls of corresponding newEmptyArray and newArray methods. This class implements all concrete newXxxMatrix via trivial calls of newMatrix method. It also offers a simple implementation of some other methods: see comments to them.
- Author:
- Daniel Alievsky
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract booleanReturns true if this memory model can create arrays with all element types.abstract booleanReturns true if this memory model can create arrays with all primitive element types: boolean, char, byte, short, int, long, float, double.abstract booleanisCreatedBy(Array array) Returns true if the passed array was created by this (or identical) memory model.abstract booleanisElementTypeSupported(Class<?> elementType) Returns true if this memory model can create arrays with this element type.abstract longmaxSupportedLength(Class<?> elementType) Returnes maximal possible length of arrays with the specified element type supported by this memory model.abstract MutableArrayAllocates a zero-filled resizable array with the specified element type and initial length.newBitArray(long initialLength) Equivalent to (MutableBitArray)newArray(boolean.class, initialLength).newBitMatrix(long... dim) Equivalent tonewMatrix(UpdatableBitArray.class, boolean.class, dim).newByteArray(long initialLength) Equivalent to (MutableByteArray)newArray(byte.class, initialLength).newByteMatrix(long... dim) Equivalent tonewMatrix(UpdatableByteArray.class, byte.class, dim).newCharArray(long initialLength) Equivalent to (MutableCharArray)newArray(char.class, initialLength).newCharMatrix(long... dim) Equivalent tonewMatrix(UpdatableCharArray.class, char.class, dim).newDoubleArray(long initialLength) Equivalent to (MutableDoubleArray)newArray(double.class, initialLength).newDoubleMatrix(long... dim) Equivalent tonewMatrix(UpdatableDoubleArray.class, double.class, dim).abstract MutableArraynewEmptyArray(Class<?> elementType) Allocates an empty resizable array with the specified element type and a little initial capacity.abstract MutableArraynewEmptyArray(Class<?> elementType, long initialCapacity) Allocates an empty resizable array with the specified element type and initial capacity.Equivalent to (MutableBitArray)newEmptyArray(boolean.class).newEmptyBitArray(long initialCapacity) Equivalent to (MutableBitArray)newEmptyArray(boolean.class, initialCapacity).Equivalent to (MutableByteArray)newEmptyArray(byte.class).newEmptyByteArray(long initialCapacity) Equivalent to (MutableByteArray)newEmptyArray(byte.class, initialCapacity).Equivalent to (MutableCharArray)newEmptyArray(char.class).newEmptyCharArray(long initialCapacity) Equivalent to (MutableCharArray)newEmptyArray(char.class, initialCapacity).Equivalent to (MutableDoubleArray)newEmptyArray(double.class).newEmptyDoubleArray(long initialCapacity) Equivalent to (MutableDoubleArray)newEmptyArray(double.class, initialCapacity).Equivalent to (MutableFloatArray)newEmptyArray(float.class).newEmptyFloatArray(long initialCapacity) Equivalent to (MutableFloatArray)newEmptyArray(float.class, initialCapacity).Equivalent to (MutableIntArray)newEmptyArray(int.class).newEmptyIntArray(long initialCapacity) Equivalent to (MutableIntArray)newEmptyArray(int.class, initialCapacity).Equivalent to (MutableLongArray)newEmptyArray(long.class).newEmptyLongArray(long initialCapacity) Equivalent to (MutableLongArray)newEmptyArray(long.class, initialCapacity).<E> MutableObjectArray<E>newEmptyObjectArray(Class<E> elementType) Equivalent to (MutableObjectArray<E>)newEmptyArray(elementType).<E> MutableObjectArray<E>newEmptyObjectArray(Class<E> elementType, long initialCapacity) Equivalent to (MutableObjectArray<E>)newEmptyArray(elementType, initialCapacity).Equivalent to (MutableShortArray)newEmptyArray(short.class).newEmptyShortArray(long initialCapacity) Equivalent to (MutableShortArray)newEmptyArray(short.class, initialCapacity).newFloatArray(long initialLength) Equivalent to (MutableFloatArray)newArray(float.class, initialLength).newFloatMatrix(long... dim) Equivalent tonewMatrix(UpdatableFloatArray.class, float.class, dim).newIntArray(long initialLength) Equivalent to (MutableIntArray)newArray(int.class, initialLength).newIntMatrix(long... dim) Equivalent tonewMatrix(UpdatableIntArray.class, int.class, dim).<T extends UpdatableArray>
 Matrix<T>newLazyCopy(Class<T> arraySupertype, Matrix<?> matrix) newLazyCopy(Array array) This implementation returns usual actual copy of the array.newLongArray(long initialLength) Equivalent to (MutableLongArray)newArray(long.class, initialLength).newLongMatrix(long... dim) Equivalent tonewMatrix(UpdatableLongArray.class, long.class, dim).<T extends UpdatableArray>
 Matrix<T>newMatrix(long maxSizeAllocatedInJavaMemory, Class<T> arraySupertype, Class<?> elementType, long... dim) This method is fully implemented in this class.<T extends UpdatableArray>
 Matrix<T>This method is fully implemented in this class.<T extends UpdatableArray>
 Matrix<T><E> MutableObjectArray<E>newObjectArray(Class<E> elementType, long initialLength) Equivalent to (MutableObjectArray<E>)newArray(elementType, initialLength).<E> Matrix<UpdatableObjectArray<E>>newObjectMatrix(Class<E> elementType, long... dim) Equivalent tonewMatrix(UpdatableObjectArray.class, elementType, dim).newShortArray(long initialLength) Equivalent to (MutableShortArray)newArray(short.class, initialLength).newShortMatrix(long... dim) Equivalent tonewMatrix(UpdatableShortArray.class, short.class, dim).<T extends UpdatableArray>
 Matrix<T>newStructuredMatrix(Class<T> arraySupertype, Matrix<?> matrix) Equivalent tonewMatrix(arraySupertype, matrix).structureLike(matrix).abstract UpdatableArraynewUnresizableArray(Class<?> elementType, long length) Allocates a zero-filled unresizable array with the specified element type and length.newUnresizableArray(Array array) newUnresizableBitArray(long initialLength) Equivalent to (UpdatableBitArray)newUnresizableArray(boolean.class, initialLength).newUnresizableByteArray(long initialLength) Equivalent to (UpdatableByteArray)newUnresizableArray(byte.class, initialLength).newUnresizableCharArray(long initialLength) Equivalent to (UpdatableCharArray)newUnresizableArray(char.class, initialLength).newUnresizableDoubleArray(long initialLength) Equivalent to (UpdatableDoubleArray)newUnresizableArray(double.class, initialLength).newUnresizableFloatArray(long initialLength) Equivalent to (UpdatableFloatArray)newUnresizableArray(float.class, initialLength).newUnresizableIntArray(long initialLength) Equivalent to (UpdatableIntArray)newUnresizableArray(int.class, initialLength).newUnresizableLazyCopy(Array array) This implementation returns usual actual copy of the array.newUnresizableLongArray(long initialLength) Equivalent to (UpdatableLongArray)newUnresizableArray(long.class, initialLength).<E> UpdatableObjectArray<E>newUnresizableObjectArray(Class<E> elementType, long initialLength) Equivalent to (UpdatableObjectArray<E>)newUnresizableArray(elementType, initialLength).newUnresizableShortArray(long initialLength) Equivalent to (UpdatableShortArray)newUnresizableArray(short.class, initialLength).valueOf(boolean[] array) Equivalent to (UpdatableBitArray)valueOf((Object)array).valueOf(boolean[] array, int offset, int count) Equivalent to (UpdatableBitArray)valueOf((Object)array, offset, count).valueOf(byte[] array) Equivalent to (UpdatableByteArray)valueOf((Object)array).valueOf(byte[] array, int offset, int count) Equivalent to (UpdatableByteArray)valueOf((Object)array, offset, count).valueOf(char[] array) Equivalent to (UpdatableCharArray)valueOf((Object)array).valueOf(char[] array, int offset, int count) Equivalent to (UpdatableCharArray)valueOf((Object)array, offset, count).valueOf(double[] array) Equivalent to (UpdatableDoubleArray)valueOf((Object)array).valueOf(double[] array, int offset, int count) Equivalent to (UpdatableDoubleArray)valueOf((Object)array, offset, count).valueOf(float[] array) Equivalent to (UpdatableFloatArray)valueOf((Object)array).valueOf(float[] array, int offset, int count) Equivalent to (UpdatableFloatArray)valueOf((Object)array, offset, count).valueOf(int[] array) Equivalent to (UpdatableIntArray)valueOf((Object)array).valueOf(int[] array, int offset, int count) Equivalent to (UpdatableIntArray)valueOf((Object)array, offset, count).valueOf(long[] array) Equivalent to (UpdatableLongArray)valueOf((Object)array).valueOf(long[] array, int offset, int count) Equivalent to (UpdatableLongArray)valueOf((Object)array, offset, count).valueOf(short[] array) Equivalent to (UpdatableShortArray)valueOf((Object)array).valueOf(short[] array, int offset, int count) Equivalent to (UpdatableShortArray)valueOf((Object)array, offset, count).<E> UpdatableObjectArray<E>valueOf(E[] array) Equivalent to (UpdatableObjectArray<E>)valueOf((Object)array).<E> UpdatableObjectArray<E>valueOf(E[] array, int offset, int count) Equivalent to (UpdatableObjectArray<E>)valueOf((Object)array, offset, count).Allocates an unresizable AlgART array containing all elements of the specified Java array: array[0], array[1], ..., array[array.length - 1].Allocates an unresizable AlgART array containing count elements of the specified Java array: array[offset], array[offset + 1], ..., array[offset + count - 1].
- 
Constructor Details- 
AbstractMemoryModelpublic AbstractMemoryModel()
 
- 
- 
Method Details- 
newEmptyArrayDescription copied from interface:MemoryModelAllocates an empty resizable array with the specified element type and a little initial capacity. It is equivalent tonewEmptyArray(elementType, n), where n is some little value.Example of usage: MutableFloatArray a = (MutableFloatArray)memoryModel.newEmptyArray(float.class); - Specified by:
- newEmptyArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyArrayDescription copied from interface:MemoryModelAllocates an empty resizable array with the specified element type and initial capacity.The element type can be either usual object class (as String.class), or one of the primitive types: boolean.class, byte.class, short.class, int.class, long.class, float.class, double.class, char.class. The element type cannot be void.class. In a case of primitive types, the created array will implement the corresponding interface BitArray,ByteArray,ShortArray,IntArray,LongArray,FloatArray,DoubleArrayorCharArray. In this case, the created array (unlike standard ArrayList) will occupy the same amount of memory as the Java array boolean[initialCapacity], byte[initialCapacity], etc.In a case of non-primitive types (Object inheritors), the created array will implement the MutableObjectArrayinterface.Some element type may be not supported by this memory model. For example, some memory models may support only primitive types, or only one concrete type. In such a case, UnsupportedElementTypeExceptionwill be thrown.Some too large array capacities may be not supported by this memory model. For example, SimpleMemoryModeldoes not support arrays larger than 0x7FFFFFFF (Integer.MAX_VALUE) elements.Example of usage: MutableFloatArray a = (MutableFloatArray)memoryModel.newEmptyArray(float.class, 10000); - Specified by:
- newEmptyArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newArrayDescription copied from interface:MemoryModelAllocates a zero-filled resizable array with the specified element type and initial length. The capacity of new array will be equal to its length.This method is equivalent to the following call: newEmptyArray(elementType, initialLength).length(initialLength).trim().- Specified by:
- newArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableArrayDescription copied from interface:MemoryModelAllocates a zero-filled unresizable array with the specified element type and length. The capacity of new array will be equal to its length.The analogous result may be obtained the following call: newArray(elementType, length).asUnresizable(). However, we don't recommend to use such code. If you are sure that you will not need to change the array length, please always use this method (ornewUnresizableBitArray,newUnresizableBteArray, etc.). In some memory models, creating resizable array with the given length may require much more resources that creating unresizable one. For example, in thelarge memory modelevery resizable array is stored in the file consisting of integer number of blocks perDataFileModel.recommendedBankSize(true)bytes.- Specified by:
- newUnresizableArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- length- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newArrayDescription copied from interface:MemoryModel- Specified by:
- newArrayin interface- MemoryModel
- Parameters:
- array- the pattern array.
- Returns:
- new AlgART array with the same length and element type.
- See Also:
 
- 
newUnresizableArrayDescription copied from interface:MemoryModel- Specified by:
- newUnresizableArrayin interface- MemoryModel
- Parameters:
- array- the pattern array.
- Returns:
- new unresizable AlgART array with the same length and element type.
- See Also:
 
- 
newEmptyBitArrayDescription copied from interface:MemoryModelEquivalent to (MutableBitArray)newEmptyArray(boolean.class).Example of usage: MutableBitArray a = memoryModel.newEmptyBitArray(); - Specified by:
- newEmptyBitArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyBitArrayDescription copied from interface:MemoryModelEquivalent to (MutableBitArray)newEmptyArray(boolean.class, initialCapacity).Example of usage: MutableBitArray a = memoryModel.newEmptyBitArray(10000); - Specified by:
- newEmptyBitArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newBitArrayDescription copied from interface:MemoryModelEquivalent to (MutableBitArray)newArray(boolean.class, initialLength).- Specified by:
- newBitArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableBitArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableBitArray)newUnresizableArray(boolean.class, initialLength).- Specified by:
- newUnresizableBitArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyCharArrayDescription copied from interface:MemoryModelEquivalent to (MutableCharArray)newEmptyArray(char.class).Example of usage: MutableCharArray a = memoryModel.newEmptyCharArray(); - Specified by:
- newEmptyCharArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyCharArrayDescription copied from interface:MemoryModelEquivalent to (MutableCharArray)newEmptyArray(char.class, initialCapacity).Example of usage: MutableCharArray a = memoryModel.newEmptyCharArray(10000); - Specified by:
- newEmptyCharArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newCharArrayDescription copied from interface:MemoryModelEquivalent to (MutableCharArray)newArray(char.class, initialLength).- Specified by:
- newCharArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableCharArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableCharArray)newUnresizableArray(char.class, initialLength).- Specified by:
- newUnresizableCharArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyByteArrayDescription copied from interface:MemoryModelEquivalent to (MutableByteArray)newEmptyArray(byte.class).Example of usage: MutableByteArray a = memoryModel.newEmptyByteArray(); - Specified by:
- newEmptyByteArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyByteArrayDescription copied from interface:MemoryModelEquivalent to (MutableByteArray)newEmptyArray(byte.class, initialCapacity).Example of usage: MutableByteArray a = memoryModel.newEmptyByteArray(10000); - Specified by:
- newEmptyByteArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newByteArrayDescription copied from interface:MemoryModelEquivalent to (MutableByteArray)newArray(byte.class, initialLength).- Specified by:
- newByteArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableByteArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableByteArray)newUnresizableArray(byte.class, initialLength).- Specified by:
- newUnresizableByteArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyShortArrayDescription copied from interface:MemoryModelEquivalent to (MutableShortArray)newEmptyArray(short.class).Example of usage: MutableShortArray a = memoryModel.newEmptyShortArray(); - Specified by:
- newEmptyShortArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyShortArrayDescription copied from interface:MemoryModelEquivalent to (MutableShortArray)newEmptyArray(short.class, initialCapacity).Example of usage: MutableShortArray a = memoryModel.newEmptyShortArray(10000); - Specified by:
- newEmptyShortArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newShortArrayDescription copied from interface:MemoryModelEquivalent to (MutableShortArray)newArray(short.class, initialLength).- Specified by:
- newShortArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableShortArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableShortArray)newUnresizableArray(short.class, initialLength).- Specified by:
- newUnresizableShortArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyIntArrayDescription copied from interface:MemoryModelEquivalent to (MutableIntArray)newEmptyArray(int.class).Example of usage: MutableIntArray a = memoryModel.newEmptyIntArray(); - Specified by:
- newEmptyIntArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyIntArrayDescription copied from interface:MemoryModelEquivalent to (MutableIntArray)newEmptyArray(int.class, initialCapacity).Example of usage: MutableIntArray a = memoryModel.newEmptyIntArray(10000); - Specified by:
- newEmptyIntArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newIntArrayDescription copied from interface:MemoryModelEquivalent to (MutableIntArray)newArray(int.class, initialLength).- Specified by:
- newIntArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableIntArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableIntArray)newUnresizableArray(int.class, initialLength).- Specified by:
- newUnresizableIntArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyLongArrayDescription copied from interface:MemoryModelEquivalent to (MutableLongArray)newEmptyArray(long.class).Example of usage: MutableLongArray a = memoryModel.newEmptyLongArray(); - Specified by:
- newEmptyLongArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyLongArrayDescription copied from interface:MemoryModelEquivalent to (MutableLongArray)newEmptyArray(long.class, initialCapacity).Example of usage: MutableLongArray a = memoryModel.newEmptyLongArray(10000); - Specified by:
- newEmptyLongArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newLongArrayDescription copied from interface:MemoryModelEquivalent to (MutableLongArray)newArray(long.class, initialLength).- Specified by:
- newLongArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableLongArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableLongArray)newUnresizableArray(long.class, initialLength).- Specified by:
- newUnresizableLongArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyFloatArrayDescription copied from interface:MemoryModelEquivalent to (MutableFloatArray)newEmptyArray(float.class).Example of usage: MutableFloatArray a = memoryModel.newEmptyFloatArray(); - Specified by:
- newEmptyFloatArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyFloatArrayDescription copied from interface:MemoryModelEquivalent to (MutableFloatArray)newEmptyArray(float.class, initialCapacity).Example of usage: MutableFloatArray a = memoryModel.newEmptyFloatArray(10000); - Specified by:
- newEmptyFloatArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newFloatArrayDescription copied from interface:MemoryModelEquivalent to (MutableFloatArray)newArray(float.class, initialLength).- Specified by:
- newFloatArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableFloatArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableFloatArray)newUnresizableArray(float.class, initialLength).- Specified by:
- newUnresizableFloatArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyDoubleArrayDescription copied from interface:MemoryModelEquivalent to (MutableDoubleArray)newEmptyArray(double.class).Example of usage: MutableDoubleArray a = memoryModel.newEmptyDoubleArray(); - Specified by:
- newEmptyDoubleArrayin interface- MemoryModel
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyDoubleArrayDescription copied from interface:MemoryModelEquivalent to (MutableDoubleArray)newEmptyArray(double.class, initialCapacity).Example of usage: MutableDoubleArray a = memoryModel.newEmptyDoubleArray(10000); - Specified by:
- newEmptyDoubleArrayin interface- MemoryModel
- Parameters:
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newDoubleArrayDescription copied from interface:MemoryModelEquivalent to (MutableDoubleArray)newArray(double.class, initialLength).- Specified by:
- newDoubleArrayin interface- MemoryModel
- Parameters:
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableDoubleArrayDescription copied from interface:MemoryModelEquivalent to (UpdatableDoubleArray)newUnresizableArray(double.class, initialLength).- Specified by:
- newUnresizableDoubleArrayin interface- MemoryModel
- Parameters:
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newEmptyObjectArrayDescription copied from interface:MemoryModelEquivalent to (MutableObjectArray<E>)newEmptyArray(elementType).Example of usage: MutableObjectArray<String> a = memoryModel.<String>newEmptyObjectArray(Class elementType); - Specified by:
- newEmptyObjectArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- Returns:
- created AlgART array.
- See Also:
 
- 
newEmptyObjectArrayDescription copied from interface:MemoryModelEquivalent to (MutableObjectArray<E>)newEmptyArray(elementType, initialCapacity).Example of usage: MutableObjectArray<String> a = memoryModel.<String>newEmptyObjectArray(10000); - Specified by:
- newEmptyObjectArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- initialCapacity- the initial capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newObjectArrayDescription copied from interface:MemoryModelEquivalent to (MutableObjectArray<E>)newArray(elementType, initialLength).- Specified by:
- newObjectArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- initialLength- the initial length and capacity of the array.
- Returns:
- created AlgART array.
- See Also:
 
- 
newUnresizableObjectArraypublic <E> UpdatableObjectArray<E> newUnresizableObjectArray(Class<E> elementType, long initialLength) Description copied from interface:MemoryModelEquivalent to (UpdatableObjectArray<E>)newUnresizableArray(elementType, initialLength).- Specified by:
- newUnresizableObjectArrayin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- initialLength- the length and capacity of the array.
- Returns:
- created unresizable AlgART array.
- See Also:
 
- 
newLazyCopyThis implementation returns usual actual copy of the array. More precisely, it is equivalent to the following operator:thisMemoryModel. newArray(array.elementType(), array.length()).copy(array);- Specified by:
- newLazyCopyin interface- MemoryModel
- Parameters:
- array- the source array.
- Returns:
- the usual identical copy of the source array.
- Throws:
- NullPointerException- if the argument is null.
- UnsupportedElementTypeException- if the element type of the passed array is not supported by this memory model.
- TooLargeArrayException- if the length of the passed array is too large for this memory model.
 
- 
newUnresizableLazyCopyThis implementation returns usual actual copy of the array. More precisely, it is equivalent to the following operator:thisMemoryModel. newUnresizableArray(array.elementType(), array.length()).copy(array);- Specified by:
- newUnresizableLazyCopyin interface- MemoryModel
- Parameters:
- array- the source array.
- Returns:
- the usual identical unresizable copy of the source array.
- Throws:
- NullPointerException- if the argument is null.
- UnsupportedElementTypeException- if the element type of the passed array is not supported by this memory model.
- TooLargeArrayException- if the length of the passed array is too large for this memory model.
 
- 
newMatrixpublic <T extends UpdatableArray> Matrix<T> newMatrix(Class<T> arraySupertype, Class<?> elementType, long... dim) This method is fully implemented in this class.- Specified by:
- newMatrixin interface- MemoryModel
- Parameters:
- arraySupertype- the desired type of the underlying array (the generic argument of the matrix type).
- elementType- the type of matrix elements.
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- Throws:
- NullPointerException- if elementType or dim is null.
- IllegalArgumentException- if elementType is void.class, or if arraySupertype is- MutableArrayor its subtype, or if the specified dimensions are incorrect: dim.length == 0, dim[n] < 0 for some n, or the product of all specified dimensions is greater than Long.MAX_VALUE.
- ClassCastException- if arraySupertype and elementType do not match.
- UnsupportedElementTypeException- if elementType is not supported by this memory model.
- TooLargeArrayException- if the product of all specified dimensions is too large for this memory model.
- See Also:
 
- 
newMatrixpublic <T extends UpdatableArray> Matrix<T> newMatrix(long maxSizeAllocatedInJavaMemory, Class<T> arraySupertype, Class<?> elementType, long... dim) This method is fully implemented in this class.- Specified by:
- newMatrixin interface- MemoryModel
- Parameters:
- maxSizeAllocatedInJavaMemory- the maximal amount of required memory, for which this method just redirects to the same method of- SimpleMemoryModel.getInstance()
- arraySupertype- the desired type of the underlying array (the generic argument of the matrix type).
- elementType- the type of matrix elements.
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- Throws:
- NullPointerException- if elementType or dim is null.
- IllegalArgumentException- if elementType is void.class, or if arraySupertype is- MutableArrayor its subtype, or if the specified dimensions are incorrect: dim.length == 0, dim[n] < 0 for some n, or the product of all specified dimensions is greater than Long.MAX_VALUE.
- ClassCastException- if arraySupertype and elementType do not match.
- UnsupportedElementTypeException- if elementType is not supported by this memory model or, for a matrix smaller than maxSizeAllocatedInJavaMemory, by- SimpleMemoryModel.
- TooLargeArrayException- if the product of all specified dimensions is too large for this memory model or, for a matrix smaller than maxSizeAllocatedInJavaMemory, by- SimpleMemoryModel.
 
- 
newMatrixDescription copied from interface:MemoryModel- Specified by:
- newMatrixin interface- MemoryModel
- Parameters:
- arraySupertype- the desired type of the underlying array of the new matrix (usually an updatable version of the built-in array of the source matrix).
- matrix- the pattern matrix.
- Returns:
- new matrix with the same dimensions and element type.
- See Also:
 
- 
newStructuredMatrixpublic <T extends UpdatableArray> Matrix<T> newStructuredMatrix(Class<T> arraySupertype, Matrix<?> matrix) Description copied from interface:MemoryModelEquivalent tonewMatrix(arraySupertype, matrix).structureLike(matrix).- Specified by:
- newStructuredMatrixin interface- MemoryModel
- Parameters:
- arraySupertype- the desired type of the underlying array of the new matrix (usually an updatable version of the built-in array of the source matrix).
- matrix- the pattern matrix.
- Returns:
- new matrix with the same dimensions, element type and similar ordering elements.
- See Also:
 
- 
newBitMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableBitArray.class, boolean.class, dim).Example of usage: Matrix<UpdatableBitArray> m = memoryModel.newBitMatrix(100, 100); - Specified by:
- newBitMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newCharMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableCharArray.class, char.class, dim).Example of usage: Matrix<UpdatableCharArray> m = memoryModel.newCharMatrix(100, 100); - Specified by:
- newCharMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newByteMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableByteArray.class, byte.class, dim).Example of usage: Matrix<UpdatableByteArray> m = memoryModel.newByteMatrix(100, 100); - Specified by:
- newByteMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newShortMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableShortArray.class, short.class, dim).Example of usage: Matrix<UpdatableShortArray> m = memoryModel.newShortMatrix(100, 100); - Specified by:
- newShortMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newIntMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableIntArray.class, int.class, dim).Example of usage: Matrix<UpdatableIntArray> m = memoryModel.newIntMatrix(100, 100); - Specified by:
- newIntMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newLongMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableLongArray.class, long.class, dim).Example of usage: Matrix<UpdatableLongArray> m = memoryModel.newLongMatrix(100, 100); - Specified by:
- newLongMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newFloatMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableFloatArray.class, float.class, dim).Example of usage: Matrix<UpdatableFloatArray> m = memoryModel.newFloatMatrix(100, 100); - Specified by:
- newFloatMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newDoubleMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableDoubleArray.class, double.class, dim).Example of usage: Matrix<UpdatableDoubleArray> m = memoryModel.newDoubleMatrix(100, 100); - Specified by:
- newDoubleMatrixin interface- MemoryModel
- Parameters:
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newObjectMatrixDescription copied from interface:MemoryModelEquivalent tonewMatrix(UpdatableObjectArray.class, elementType, dim).Example of usage: Matrix<UpdatableObjectArray<String>> m = memoryModel.newObjectMatrix(String.class, 100, 100); - Specified by:
- newObjectMatrixin interface- MemoryModel
- Parameters:
- elementType- the type of matrix elements.
- dim- the dimensions of the matrix.
- Returns:
- created matrix.
- See Also:
 
- 
newLazyCopyDescription copied from interface:MemoryModel- Specified by:
- newLazyCopyin interface- MemoryModel
- Parameters:
- arraySupertype- the desired type of the underlying array of the new lazy copy (usually an updatable version of the built-in array of the source matrix).
- matrix- the source matrix.
- Returns:
- the lazy copy of the source matrix, if lazy copying is supported by the memory model, or the usual identical copy of the source matrix in other case.
 
- 
valueOfDescription copied from interface:MemoryModelAllocates an unresizable AlgART array containing count elements of the specified Java array: array[offset], array[offset + 1], ..., array[offset + count - 1].The returned AlgART array will be "safe" in the sense that no references to the passed Java array are maintained by it. In other words, this method must always allocate a new AlgART array. This method is equivalent to the following expression: newUnresizableArray(elementType, count).setData(0, array, offset, count), where elementType is the type of array elements (array.getClass().getComponentType()).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelAllocates an unresizable AlgART array containing all elements of the specified Java array: array[0], array[1], ..., array[array.length - 1].The returned AlgART array will be "safe" in the sense that no references to the passed Java array are maintained by it. In other words, this method must always allocate a new array. This method is equivalent to the following expression: newUnresizableArray(elementType, len).setData(0, array), where elementType is the type of array elements (array.getClass().getComponentType()) and len is the length of the passed Java array.- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableBitArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableBitArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableCharArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableCharArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableByteArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableByteArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableShortArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableShortArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableIntArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableIntArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableLongArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableLongArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableFloatArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableFloatArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableDoubleArray)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableDoubleArray)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableObjectArray<E>)valueOf((Object)array, offset, count).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- offset- starting position in the source Java array.
- count- the length of returned AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
valueOfDescription copied from interface:MemoryModelEquivalent to (UpdatableObjectArray<E>)valueOf((Object)array).- Specified by:
- valueOfin interface- MemoryModel
- Parameters:
- array- the source Java array with elements of constructed AlgART array.
- Returns:
- created unresizable AlgART array.
 
- 
isElementTypeSupportedDescription copied from interface:MemoryModelReturns true if this memory model can create arrays with this element type. If it does not support it, creation methods of this memory model will throwUnsupportedElementTypeException. The result is not defined for void.class.- Specified by:
- isElementTypeSupportedin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- Returns:
- true if this memory model supports this element type.
 
- 
areAllPrimitiveElementTypesSupportedpublic abstract boolean areAllPrimitiveElementTypesSupported()Description copied from interface:MemoryModelReturns true if this memory model can create arrays with all primitive element types: boolean, char, byte, short, int, long, float, double.- Specified by:
- areAllPrimitiveElementTypesSupportedin interface- MemoryModel
- Returns:
- true if this memory model supports all primitive element types.
- See Also:
 
- 
areAllElementTypesSupportedpublic abstract boolean areAllElementTypesSupported()Description copied from interface:MemoryModelReturns true if this memory model can create arrays with all element types. This package offers only one such memory model:SimpleMemoryModel.- Specified by:
- areAllElementTypesSupportedin interface- MemoryModel
- Returns:
- true if this memory model supports element types.
- See Also:
 
- 
maxSupportedLengthDescription copied from interface:MemoryModelReturnes maximal possible length of arrays with the specified element type supported by this memory model. If the capacity / length passed toMemoryModel.newEmptyArray(Class, long)/MemoryModel.newArray(Class, long)methods is greater than the result of this method, they will throwTooLargeArrayException. The result is not defined it the passed element type is not supported by this memory model (for example, it may be -1).For some memory model, the method may be not enough informative: creation methods may throw TooLargeArrayExceptioneven if the passed capacity / length is less than the result of this method. Please refer to the documentation of the corresponding memory model to know the precise behavior of this method. In any case, maximal possible array length is restricted by the amount of Java memory.- Specified by:
- maxSupportedLengthin interface- MemoryModel
- Parameters:
- elementType- the type of array elements.
- Returns:
- maximal possible length of arrays supported by this memory model.
 
- 
isCreatedByDescription copied from interface:MemoryModelReturns true if the passed array was created by this (or identical) memory model.For SimpleMemoryModelandBufferMemoryModel, "identical" means the same memory model.For LargeMemoryModel, "identical" means that the memory model is also large and was created with the same instance of thedata file factory.For CombinedMemoryModel, "identical" means that the memory model is also combined and was created with the same instance of thecombiner.Returns false if the passed argument is null. - Specified by:
- isCreatedByin interface- MemoryModel
- Parameters:
- array- the AlgART array (may be null, than the method returns false).
- Returns:
- true if the passed array was created by this memory model.
 
 
-