jsky.science
Interface ScienceObjectModel

All Superinterfaces:
java.util.EventListener, java.beans.PropertyChangeListener, ReplaceablePropertyChangeListener
All Known Subinterfaces:
ScienceObjectNodeModel, Spectrum, Wavelength1DModel
All Known Implementing Classes:
AbstractScienceObject, AbstractScienceObjectNode, AbstractWavelength1D, Flux, Passband, ProperMotion, Quantity, Redshift, Spectrum1DArray, Time, Wavelength, Wavelength1DArray, Wavelength1DFormula

public interface ScienceObjectModel
extends ReplaceablePropertyChangeListener

Defines the basic functionality required for a class to interact within the "Science" framework. This framework was design initially for the Scientist's Expert Assistant (SEA) and provide a common superclass for a set of science- oriented constructs to work together.

This code was originally developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).


Field Summary
static java.lang.String NAME_PROPERTY
          Property name affiliated with the Name property of a ScienceObjectModel.
static java.lang.String PENDING_PROPERTY
          Property names used by subclasses to indicate a change in a subclass' Validity status.
static java.lang.String VALID_PROPERTY
          Deprecated. - not being used
 
Method Summary
 void addPropertyChangeListener(ReplaceablePropertyChangeListener listener)
          Adds a listener to receive PropertyChangeNotifications and Replacement events.
 void clearAllListeners()
          Removes all listeners.
 java.lang.Object clone()
          Define a clone() without throwing an exception.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Covering method to fire a property change notification to listeners.
 java.lang.Exception getException()
          For validity purposes, a ScienceObjectNode will be "valid" if it has no exceptions assigned to it.
 java.lang.String getLabel()
          Returns a Label property - may be same as Name or same as toString() or provide a different implementation
 java.lang.String getName()
          Returns the Name property, should NOT return a null
 ScienceObjectNodeModel getParent()
          Returns the parent, if any.
 boolean isHolding()
          Return the internal "held" state of the object.
 boolean isTracing()
          Returns true if this object should have its property change events traced.
 boolean isValid()
          Returns a boolean indicating whether the internal state of the object is in a valid state and its information scientifically sound.
 void removePropertyChangeListener(ReplaceablePropertyChangeListener listener)
          Removes a listener for receiving PropertyChangeNotifications and Replacement events.
 void setException(java.lang.Exception e)
          Sets an exception on the object, presumably making it "invalid"
 void setHolding(boolean hold)
          Sets the hold state for an object.
 void setName(java.lang.String name)
          Sets the Name property
 void setParent(ScienceObjectNodeModel model)
          Sets the parent of this object.
 void setTracing(boolean trace)
          Sets the tracing level for this object.
 
Methods inherited from interface jsky.util.ReplaceablePropertyChangeListener
replaceObject
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

NAME_PROPERTY

static final java.lang.String NAME_PROPERTY
Property name affiliated with the Name property of a ScienceObjectModel. This name is used in events involving the Name property


VALID_PROPERTY

static final java.lang.String VALID_PROPERTY
Deprecated. - not being used
Property names used by subclasses to indicate a change in a subclass' Validity status.


PENDING_PROPERTY

static final java.lang.String PENDING_PROPERTY
Property names used by subclasses to indicate a change in a subclass' Validity status.

Method Detail

getParent

ScienceObjectNodeModel getParent()
Returns the parent, if any. May be null.


setParent

void setParent(ScienceObjectNodeModel model)
Sets the parent of this object. When set property changes will be propagated from child objects to parent objects


clone

java.lang.Object clone()
Define a clone() without throwing an exception. All implementers of ScienceObjectModel should be able to clone themselves.


isHolding

boolean isHolding()
Return the internal "held" state of the object. Allows objects to put themselves on "hold". Useful if updating an object requires a time-consuming update process (such as a remote server call).

Internally, when holding is set to true a ScienceObjectModel should not perform the update process, but should track whether or not updates are needed.

See AbstractScienceObjectNode for an implementation example.


setHolding

void setHolding(boolean hold)
Sets the hold state for an object.


isTracing

boolean isTracing()
Returns true if this object should have its property change events traced. This is primarily an debugging utility.


setTracing

void setTracing(boolean trace)
Sets the tracing level for this object.

See Also:
isTracing()

addPropertyChangeListener

void addPropertyChangeListener(ReplaceablePropertyChangeListener listener)
Adds a listener to receive PropertyChangeNotifications and Replacement events.


removePropertyChangeListener

void removePropertyChangeListener(ReplaceablePropertyChangeListener listener)
Removes a listener for receiving PropertyChangeNotifications and Replacement events.


clearAllListeners

void clearAllListeners()
Removes all listeners.


firePropertyChange

void firePropertyChange(java.lang.String propertyName,
                        java.lang.Object oldValue,
                        java.lang.Object newValue)
Covering method to fire a property change notification to listeners.


getName

java.lang.String getName()
Returns the Name property, should NOT return a null


setName

void setName(java.lang.String name)
Sets the Name property


getLabel

java.lang.String getLabel()
Returns a Label property - may be same as Name or same as toString() or provide a different implementation


getException

java.lang.Exception getException()
For validity purposes, a ScienceObjectNode will be "valid" if it has no exceptions assigned to it. This method should return the exception assocation with this instance if any


setException

void setException(java.lang.Exception e)
Sets an exception on the object, presumably making it "invalid"


isValid

boolean isValid()
Returns a boolean indicating whether the internal state of the object is in a valid state and its information scientifically sound.