Package uk.ac.starlink.array
Class MouldArrayImpl
java.lang.Object
uk.ac.starlink.array.WrapperArrayImpl
uk.ac.starlink.array.MouldArrayImpl
- All Implemented Interfaces:
ArrayImpl
Wraps an NDArray to provide one with identical pixel data, but viewed
as a different shape, that is with its origin or dimensions different.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionMouldArrayImpl
(NDArray nda, NDShape shape) Creates a new ArrayImpl which which uses the pixels from an underlying NDArray moulded into a different shape (origin/dimensions). -
Method Summary
Modifier and TypeMethodDescriptiongetShape()
Returns an object representing the shape (origin and dimensions) and pixel sequence of this object.Methods inherited from class uk.ac.starlink.array.WrapperArrayImpl
canMap, close, getAccess, getBadValue, getMapped, getType, getWrapped, isRandom, isReadable, isWritable, multipleAccess, open, toString
-
Constructor Details
-
MouldArrayImpl
Creates a new ArrayImpl which which uses the pixels from an underlying NDArray moulded into a different shape (origin/dimensions). The number of pixels must be the same in the base NDArray and the requested new shape.- Parameters:
nda
- the base NDArray which will supply the pixelsshape
- the shape which this NDArray is to have- Throws:
IllegalArgumentException
- if shape is does not have the same number of pixels as the shape of nda
-
-
Method Details
-
getShape
Description copied from interface:ArrayImpl
Returns an object representing the shape (origin and dimensions) and pixel sequence of this object. The return value must not change over the lifetime of the object.- Specified by:
getShape
in interfaceArrayImpl
- Overrides:
getShape
in classWrapperArrayImpl
- Returns:
- the ordered shape
-