public class DefaultMutableNdx extends BridgeNdx implements MutableNdx
MutableNdx
interface,
so provides mutator methods as well as the accessor methods of Ndx.
This class can be used to wrap a (presumably immutable) existing Ndx
object, or to construct a mutable Ndx from an NdxImpl object.BridgeNdx.BridgeNdxHdxFacade
ndxDocumentCache
Constructor and Description |
---|
DefaultMutableNdx(NDArray image)
Constructs a MutableNdx from a given
NDArray which
will be its Image component. |
DefaultMutableNdx(Ndx ndx)
Constructs a MutableNdx from a given Ndx.
|
DefaultMutableNdx(NdxImpl impl)
Constructs a MutableNdx from a given NdxImpl.
|
Modifier and Type | Method and Description |
---|---|
FrameSet |
getAst()
Get the world coordinate system of the NDX as
an AST
FrameSet . |
int |
getBadBits()
Gets the value of the badBits mask.
|
Source |
getEtc()
Returns the XML containing extension information for this NDX.
|
NDArray |
getImage()
Returns the image component of this NDX.
|
String |
getLabel()
Returns the label string for this Ndx.
|
NDArray |
getQuality()
Returns the quality component of this NDX.
|
String |
getTitle()
Returns the title of this Ndx.
|
String |
getUnits()
Returns the units string for this Ndx.
|
NDArray |
getVariance()
Returns the variance component of this NDX.
|
boolean |
hasEtc()
Find out if the NDX contains user-defined extension information.
|
boolean |
hasLabel()
Indicates whether there is a label component.
|
boolean |
hasQuality()
Indicates whether there is a quality component.
|
boolean |
hasTitle()
Indicates whether there is a title component.
|
boolean |
hasUnits()
Indicates whether there is a units component.
|
boolean |
hasVariance()
Indicates whether there is a variance component.
|
boolean |
hasWCS()
Find out if the NDX has World Coordinate System information.
|
void |
setBadBits(int badbits)
Sets the bad bits mask for this Ndx.
|
void |
setEtc(Node etc)
Sets the Etc component of this Ndx.
|
void |
setImage(NDArray image)
Sets the Image component of this Ndx.
|
void |
setLabel(String label)
Sets the label component of this Ndx.
|
void |
setQuality(NDArray quality)
Sets the Quality component of this Ndx.
|
void |
setTitle(String title)
Sets the title component of this Ndx.
|
void |
setUnits(String units)
Sets the units component of this Ndx.
|
void |
setVariance(NDArray variance)
Sets the Variance component of this Ndx.
|
void |
setWCS(Object wcsob)
Sets the WCS component of this Ndx.
|
getHdxFacade, getHdxResourceType, isPersistent, toXML
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHdxFacade, isPersistent, toXML
public DefaultMutableNdx(NdxImpl impl)
BridgeNdx
constructed from impl
until such time as one of the set
methods is used on it,
after which time the new value(s) will be returned by the
corresponding get
methods.impl
- the implementation object on which this Ndx will be basedpublic DefaultMutableNdx(Ndx ndx)
set
methods is used on it,
after which time the new value(s) will be returned by the
corresponding get
methods.ndx
- the underlying Ndx on which this one will be basedpublic DefaultMutableNdx(NDArray image)
NDArray
which
will be its Image component.
The resulting object has no optional components (title, etc and so on),
though these can be set using the various set
methods.image
- the Image component of this NdxNullPointerException
- if image
is null
public void setImage(NDArray image)
MutableNdx
null
value.setImage
in interface MutableNdx
image
- the new Image componentpublic NDArray getImage()
Ndx
Note that this returns the raw image NDArray
object,
which should not in general be used directly for reading image
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the image data for read access,
use the Ndxs.getMaskedImage(Ndx)
method.
public void setVariance(NDArray variance)
MutableNdx
null
the Ndx will be considered
to have no Variance component.setVariance
in interface MutableNdx
variance
- the new Variance componentpublic boolean hasVariance()
Ndx
hasVariance
in interface Ndx
hasVariance
in class BridgeNdx
Ndx.getVariance()
may be calledpublic NDArray getVariance()
Ndx
Note that this returns the raw variance
NDArray
object,
which should not in general be used directly for reading variance
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the variance data for read access,
use the Ndxs.getMaskedVariance(Ndx)
method.
May only be called if Ndx.hasVariance()
returns true
.
getVariance
in interface Ndx
getVariance
in class BridgeNdx
public void setQuality(NDArray quality)
MutableNdx
null
the Ndx will be considered to have
no Quality component.setQuality
in interface MutableNdx
quality
- the new Quality componentpublic boolean hasQuality()
Ndx
hasQuality
in interface Ndx
hasQuality
in class BridgeNdx
Ndx.getQuality()
may be calledpublic NDArray getQuality()
Ndx
May only be called if Ndx.hasQuality()
returns true
.
getQuality
in interface Ndx
getQuality
in class BridgeNdx
public void setBadBits(int badbits)
MutableNdx
setBadBits
in interface MutableNdx
badbits
- the new bad bits maskpublic int getBadBits()
Ndx
getBadBits
in interface Ndx
getBadBits
in class BridgeNdx
public void setTitle(String title)
MutableNdx
setTitle
in interface MutableNdx
title
- the new title.
If null
, this Ndx will be considered to have
no titlepublic boolean hasTitle()
Ndx
hasTitle
in interface Ndx
hasTitle
in class BridgeNdx
Ndx.getTitle()
may be calledpublic String getTitle()
Ndx
Ndx.hasTitle()
returns true
.public void setLabel(String label)
MutableNdx
setLabel
in interface MutableNdx
label
- the new label.
if null
, this Ndx will be considered to have
no labelpublic boolean hasLabel()
Ndx
hasLabel
in interface Ndx
hasLabel
in class BridgeNdx
Ndx.getLabel()
may be calledpublic String getLabel()
Ndx
Ndx.hasLabel()
returns true
.public void setUnits(String units)
MutableNdx
setUnits
in interface MutableNdx
units
- the new units string.
if null
, this Ndx will be considered to have no
units componentpublic boolean hasUnits()
Ndx
hasUnits
in interface Ndx
hasUnits
in class BridgeNdx
Ndx.getUnits()
may be calledpublic String getUnits()
Ndx
Ndx.hasUnits()
returns true
.public void setWCS(Object wcsob)
MutableNdx
setWCS
in interface MutableNdx
wcsob
- an object representing the new WCS component
If null
, a default WCS will be usedpublic boolean hasWCS()
Ndx
If it exists, then the Ndx.getAst()
method may be called to
access it as an AST FrameSet
.
Note: in due course, when the uk.ac.starlink.wcs
package has been released a getWCS
method will be
provided to access it as a WCS
object.
hasWCS
in interface Ndx
hasWCS
in class BridgeNdx
Ndx.getAst()
(and in due course getWCS
can be calledpublic FrameSet getAst()
Ndx
FrameSet
.
Note: This method is intended as a temporary measure
until the uk.ac.starlink.wcs
package has been released.
At that time a getWCS
method will be provided, and
this one will be deprecated.
getAst
in interface Ndx
getAst
in class BridgeNdx
Ndx.hasWCS()
public void setEtc(Node etc)
MutableNdx
null
the supplied Node should be a Document or Element of type <etc>.setEtc
in interface MutableNdx
etc
- the new user-defined extensions component as a DOM node.
If null
, this Ndx will be considered to have no
extensionspublic boolean hasEtc()
Ndx
hasEtc
in interface Ndx
hasEtc
in class BridgeNdx
Ndx.getEtc()
may be calledpublic Source getEtc()
Ndx
<etc>
which contains an element for each extension.
May only be called if Ndx.hasEtc()
returns true
.getEtc
in interface Ndx
getEtc
in class BridgeNdx
SourceReader
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.