|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.probe.traj.Trajectory
Manages the history for a probe. Saves ProbeState objects,
each of which reflects the state of the Probe at a particular
point in time.
| Field Summary | |
static java.lang.String |
TRAJ_LABEL
XML element tag for trajectory |
| Constructor Summary | |
Trajectory()
Create a new, emtpy Trajectory object. |
|
| Method Summary | |
protected void |
addPropertiesTo(DataAdaptor container)
Override this method in subclasses to add subclass-specific properties to the output. |
java.lang.String |
getDescription()
Return the user comment associated with this trajectory. |
java.util.Date |
getTimestamp()
Return the time stamp of the trajectory object |
int[] |
indicesForElement(java.lang.String element)
Returns an array of the state indices corresponding to the specified element. |
ProbeState |
initialState()
Returns the probe's initial state or null if there is none. |
void |
load(DataAdaptor container)
Load the current Trajectory object with the state history
information in the DataAdaptor object. |
protected abstract ProbeState |
newProbeState()
Creates a new ProbeState object with the proper type for the trajectory. |
protected abstract ProbeState |
newProbeState(IProbe probe)
Creates a new ProbeState object with the proper type for the trajectory. |
int |
numStates()
Return the number of states in the trajectory. |
ProbeState |
popLastState()
Remove the last state from the trajectory and return it. |
static Trajectory |
readFrom(DataAdaptor container)
Read the contents of the supplied DataAdaptor and return
an instance of the appropriate Trajectory species. |
protected void |
readPropertiesFrom(DataAdaptor container)
Allow subclasses to read subclass-specific properties from the
DataAdaptor. |
void |
save(DataAdaptor container)
Adds a representation of this Trajectory and its state history to the supplied DataAdaptor. |
void |
saveState(ProbeState s)
Save the ProbeState object directly to the trajectory at the tail. |
void |
setDescription(java.lang.String strDescr)
Set the user comment string |
void |
setTimestamp(long lngTimeStamp)
Set the time stamp of the trajectory. |
ProbeState |
stateAtPosition(double pos)
Returns the probe state at the specified position. |
java.util.Iterator |
stateIterator()
Return an Iterator over the iterator's states. |
ProbeState[] |
statesForElement(java.lang.String strElemId)
Returns the states associated with the specified element. |
ProbeState[] |
statesInPositionRange(double low,
double high)
Returns the states that fall within the specified position range, inclusive. |
ProbeState |
stateWithIndex(int i)
Returns the state corresponding to the specified index, or null if there is none. |
java.lang.String |
toString()
Store a textual representation of the trajectory to a string |
void |
update(IProbe probe)
Captures the specified probe's current state to a ProbeState object
then saves it to the trajectory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String TRAJ_LABEL
| Constructor Detail |
public Trajectory()
Trajectory object.
| Method Detail |
public static Trajectory readFrom(DataAdaptor container)
throws ParsingException
DataAdaptor and return
an instance of the appropriate Trajectory species.
container - DataAdaptor to read a Trajectory from
ParsingException - error encountered reading the DataAdaptorprotected abstract ProbeState newProbeState()
ProbeState object with the proper type for the trajectory.
ProbeState objectprotected abstract ProbeState newProbeState(IProbe probe)
ProbeState object with the proper type for the trajectory.
Initialize new ProbeState to the state of the argument.
probe - probe interface belonging to object with the proper type for this trajectory
ProbeState object initialized to probeprotected void addPropertiesTo(DataAdaptor container)
container - the DataAdaptor to add properties to
protected void readPropertiesFrom(DataAdaptor container)
throws ParsingException
DataAdaptor. Implementations should call super.readPropertiesFrom
to ensure that superclass implementations are executed.
container - DataAdaptor to read properties from
ParsingExceptionpublic void setDescription(java.lang.String strDescr)
strDescr - user comment stringpublic void setTimestamp(long lngTimeStamp)
lngTimeStamp - number of milliseconds since January 1, 1970 GMTpublic void update(IProbe probe)
ProbeState object
then saves it to the trajectory. State goes at the tail of the trajectory list.
probe - target probe objectpublic void saveState(ProbeState s)
ProbeState object directly to the trajectory at the tail.
public ProbeState popLastState()
ProbeState in the historypublic java.lang.String getDescription()
public java.util.Date getTimestamp()
public java.util.Iterator stateIterator()
public int numStates()
public ProbeState initialState()
public ProbeState stateAtPosition(double pos)
public ProbeState[] statesInPositionRange(double low,
double high)
low - lower bound on position rangehigh - upper bound on position range
ProbeState objects whose position falls
within the specified rangepublic ProbeState[] statesForElement(java.lang.String strElemId)
strElemId - the name of the element to search for
ProbeState objects for that elementpublic int[] indicesForElement(java.lang.String element)
element - name of element to search for
public ProbeState stateWithIndex(int i)
i - index of state to return
public java.lang.String toString()
toString in class java.lang.Objectpublic void save(DataAdaptor container)
DataAdaptor.
save in interface IArchivecontainer - DataAdaptor in which to add Trajectory data
public void load(DataAdaptor container)
throws DataFormatException
Trajectory object with the state history
information in the DataAdaptor object.
load in interface IArchivecontainer - DataAdaptor from which state history is extracted
DataFormatException - malformated data in DataAdaptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||