Package uk.ac.starlink.array
Class MouldArrayImpl
- java.lang.Object
-
- uk.ac.starlink.array.WrapperArrayImpl
-
- uk.ac.starlink.array.MouldArrayImpl
-
- All Implemented Interfaces:
ArrayImpl
public class MouldArrayImpl extends WrapperArrayImpl
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
Constructors Constructor Description MouldArrayImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OrderedNDShape
getShape()
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 Detail
-
MouldArrayImpl
public MouldArrayImpl(NDArray nda, NDShape shape)
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:
java.lang.IllegalArgumentException
- if shape is does not have the same number of pixels as the shape of nda
-
-
Method Detail
-
getShape
public OrderedNDShape 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
-
-