uk.ac.starlink.ndx
Interface NdxImpl

All Known Implementing Classes:
WrapperNdxImpl

public interface NdxImpl

Interface for the implementation end of the Ndx bridge pattern. If you have an NdxImpl you can make an Ndx out of it. This is the basic interface via which NDX implementations provide services to the BridgeNdx class. BridgeNdx is intended to be the only client of this class, and it does the necessary validation of arguments before passing them to NdxImpl, so that implementations of this interface can in general assume that the arguments they receive make sense.

Note that BridgeNdx may cache information from the methods defined here, so objects implementing this interface should be considered effectively immutable; if an instance of NdxImpl changes the return value of getTitle at some point after it has been passed to the BridgeNdx constructor it is not defined which value an invocation of the BridgeNdx.getTitle method will return. For this reason it is not generally worthwhile for implementations of this interface to perform caching for performance reasons except where noted, since most of the get methods will be called only once.

Author:
Mark Taylor, Peter W. Draper
See Also:
Ndx, BridgeNdx

Method Summary
 int getBadBits()
          Returns the bad bits mask used to mask the image/variance arrays against the quality array.
 Source getEtc()
          Gets an XML Source holding the extension information.
 NDArray getImage()
          Gets an NDArray containing the image data.
 String getLabel()
          Gets the label component.
 NDArray getQuality()
          Gets an NDArray containing the quality data.
 String getTitle()
          Gets the title component.
 String getUnits()
          Gets the units component.
 NDArray getVariance()
          Gets an NDArray containing the variance data.
 Object getWCS()
          Gets an object representing the world coordinate systems of this Ndx.
 boolean hasEtc()
          Indicates whether an extensions DOM is available.
 boolean hasLabel()
          Indicates whether a label component is available.
 boolean hasQuality()
          Indicates whether quality array data is present.
 boolean hasTitle()
          Indicates whether a title component is available.
 boolean hasUnits()
          Indicates whether a units component is available.
 boolean hasVariance()
          Indicates whether variance array data is present.
 boolean hasWCS()
          Indicates whether a WCS component is available.
 

Method Detail

getBadBits

int getBadBits()
Returns the bad bits mask used to mask the image/variance arrays against the quality array. A value of 0 (quality has no effect) should be returned if no other value is available.

Returns:
the bad bits mask

hasTitle

boolean hasTitle()
Indicates whether a title component is available.

Returns:
true if and only if getTitle() will return a string

getTitle

String getTitle()
Gets the title component. This method will only be called if hasTitle() returns true.

Returns:
a string containing the Ndx title

hasLabel

boolean hasLabel()
Indicates whether a label component is available.

Returns:
true if and only if getLabel() will return a string

getLabel

String getLabel()
Gets the label component. This method will only be called if hasLabel() returns true.

Returns:
a string containing the Ndx label (data description)

hasUnits

boolean hasUnits()
Indicates whether a units component is available.

Returns:
true if and only if getUnits() will return a string

getUnits

String getUnits()
Gets the units component. This method will only be called if hasUnits() returns true.

Returns:
a string containing the units of the Ndx data

hasWCS

boolean hasWCS()
Indicates whether a WCS component is available.

Returns:
true if and only if getWCS will return a representation of the world coordinate system of this Ndx

getWCS

Object getWCS()
Gets an object representing the world coordinate systems of this Ndx. This may be returned in one of a number of forms; currently This method will only be called if hasWCS() returns true.

Returns:
a FrameSet or Element object representing the WCS

hasEtc

boolean hasEtc()
Indicates whether an extensions DOM is available.

Returns:
true if and only if getEtc will return an XML Source giving extension information for this Ndx

getEtc

Source getEtc()
Gets an XML Source holding the extension information. This method will only be called if hasEtc() returns true. The result must represent an element, or a document with a root element, whose tagname is "etc". This method may be called more than once by BridgeNdx, so it must not return a source which may have been exhausted by a previous call (for instance an old StreamSource).

Returns:
the extension information in XML form

getImage

NDArray getImage()
Gets an NDArray containing the image data.

Returns:
image NDArray

hasVariance

boolean hasVariance()
Indicates whether variance array data is present.

Returns:
true if and only if variance data is available

getVariance

NDArray getVariance()
Gets an NDArray containing the variance data. This method will only be called if hasVariance() returns true.

Returns:
variance NDArray

hasQuality

boolean hasQuality()
Indicates whether quality array data is present.

Returns:
true if and only if quality data is present

getQuality

NDArray getQuality()
Gets an NDArray containing the quality data. This method will only be called if hasQuality() returns true.

Returns:
quality NDArray


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