uk.ac.starlink.array
Class DummyNDArray

java.lang.Object
  extended by uk.ac.starlink.array.DefaultArrayDescription
      extended by uk.ac.starlink.array.BridgeNDArray
          extended by uk.ac.starlink.array.DummyNDArray
All Implemented Interfaces:
ArrayDescription, NDArray

public class DummyNDArray
extends BridgeNDArray

NDArray backed by no data. It is read-only, and all its pixels have the bad value. It may be used as a source of bad values, or as a place-holder where an NDArray of a certain shape and type is required but whose data is not needed.

For a more flexible no-data array use the DeterministicArrayImpl class (or write your own).

Author:
Mark Taylor (Starlink)
See Also:
DeterministicArrayImpl

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.array.BridgeNDArray
BridgeNDArray.BridgeNDArrayHdxFacade
 
Field Summary
 
Fields inherited from class uk.ac.starlink.array.DefaultArrayDescription
arrayDims, arrayHandler, arrayIsRandom, arrayIsReadable, arrayIsWritable, arrayNdim, arrayNpix, arrayOrder, arrayOrigin, arrayShape, arrayType
 
Constructor Summary
DummyNDArray(NDArray nda)
          Constructs a new DummyNDArray with the same characteristics (pixel sequence, type and bad value handler) as a template NDArray.
DummyNDArray(NDShape shape, Type type)
          Constructs a new DummyNDArray with a given shape and type and default pixel sequence and bad value.
DummyNDArray(OrderedNDShape oshape, Type type, BadHandler bh)
          Constructs a new DummyNDArray with a given shape and type and bad value handler.
 
Method Summary
 
Methods inherited from class uk.ac.starlink.array.BridgeNDArray
close, getAccess, getHdxFacade, getImpl, getURL, multipleAccess, toString
 
Methods inherited from class uk.ac.starlink.array.DefaultArrayDescription
getBadHandler, getShape, getType, isRandom, isReadable, isWritable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.array.ArrayDescription
getBadHandler, getShape, getType, isRandom, isReadable, isWritable
 

Constructor Detail

DummyNDArray

public DummyNDArray(OrderedNDShape oshape,
                    Type type,
                    BadHandler bh)
Constructs a new DummyNDArray with a given shape and type and bad value handler. By setting the bad value handler appropriately, the primitive value that the array returns can be modified.

Parameters:
oshape - the pixel sequence
type - the numeric type
bh - the bad value handler

DummyNDArray

public DummyNDArray(NDShape shape,
                    Type type)
Constructs a new DummyNDArray with a given shape and type and default pixel sequence and bad value.

Parameters:
shape - the shape
type - the numeric type

DummyNDArray

public DummyNDArray(NDArray nda)
Constructs a new DummyNDArray with the same characteristics (pixel sequence, type and bad value handler) as a template NDArray.

Parameters:
nda - template NDArray


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.