public class CombineArrayImpl extends Object implements ArrayImpl
Combiner
object.
Type conversions are taken care of, and values which end up outside
the range of the type of the resulting array are automatically
turned Bad.Constructor and Description |
---|
CombineArrayImpl(NDArray nda1,
NDArray nda2,
Combiner combi,
NDShape shape,
Type type,
BadHandler bh)
Construct a new CombineArrayImpl based on two underlying NDArrays
and a combiner object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canMap()
Indicates whether mapped access is available.
|
void |
close()
Shuts down this ArrayImpl for pixel access.
|
AccessImpl |
getAccess()
Returns an object which can access the pixels of this ArrayImpl.
|
Number |
getBadValue()
The magic bad value for data.
|
Object |
getMapped()
Returns a single primitive array holding all the pixel data of
this array.
|
OrderedNDShape |
getShape()
Returns an object representing the shape (origin and dimensions)
and pixel sequence of this object.
|
Type |
getType()
Returns the primitive type of the data held by this object.
|
boolean |
isRandom()
Indicates whether random access is possible.
|
boolean |
isReadable()
Indicates whether read access is possible.
|
boolean |
isWritable()
Indicates whether write access is possible.
|
boolean |
multipleAccess()
Indicates whether the getAccess method may be called more than once.
|
void |
open()
Prepares this ArrayImpl for pixel access.
|
public CombineArrayImpl(NDArray nda1, NDArray nda2, Combiner combi, NDShape shape, Type type, BadHandler bh)
nda1
- the first array to combinenda2
- the second array to combinecombi
- the object which performs the arithmetic combinationshape
- the shape of the resulting array objecttype
- the type of the resulting array objectbh
- the bad value handler for the resulting array object.
If null
, a non-null bad value handler using a
default value is used.public OrderedNDShape getShape()
ArrayImpl
public Type getType()
ArrayImpl
public Number getBadValue()
ArrayImpl
null
if there is no bad value.
The return value must not change over the lifetime of the object.getBadValue
in interface ArrayImpl
public boolean isReadable()
ArrayImpl
isReadable
in interface ArrayImpl
public boolean isWritable()
ArrayImpl
isWritable
in interface ArrayImpl
public boolean isRandom()
ArrayImpl
public boolean multipleAccess()
ArrayImpl
multipleAccess
in interface ArrayImpl
public void open() throws IOException
ArrayImpl
open
in interface ArrayImpl
IOException
- if there is an IO errorpublic boolean canMap()
ArrayImpl
Will only be called after an open call, and before any close call.
public Object getMapped()
ArrayImpl
Will only be called if canMap returns true, and only after an open call and before any close call.
public AccessImpl getAccess() throws IOException
ArrayImpl
This method will only be called after the sole call to open and before the sole call to close.
This method will only be called more than once if the multipleAccess method returns true.
It is the responsibility of the caller to close the returned AccessImpl when it is no longer required; this enables resources it may hold to be released.
getAccess
in interface ArrayImpl
IOException
- if there is an IO errorpublic void close() throws IOException
ArrayImpl
close
in interface ArrayImpl
IOException
- if there is an IO errorCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.