stella
Interface HistoryAware

All Superinterfaces:
Handable, TargetDefinition
All Known Implementing Classes:
GrbTarget, ParsedTarget

public interface HistoryAware
extends Handable

An interface describing targets with an observing history. The target has access to its successful and unsuccessful observations. As only handable targets may collect history information, this interface extends the Handable interface rather than the TargetDefinition interface.


Nested Class Summary
static interface HistoryAware.Pick
          Objects implementing this interface are list elements returned by the getEntireHistory() method.
 
Method Summary
 void addExecution(ParameterClustering set, Date start, long dur, String unique, String comment)
          Adds an execution to the target.
 List<HistoryAware.Pick> getEntireHistory()
          Returns a list of all observations stored in the document.
 HistoryAware.Pick getFailure(int nr)
          Returns the date of the specified unsuccessful observation.
 int getFailureCount()
          Returns the number of unsuccessfully performed observations of the target.
 HistoryAware.Pick getFirstFailure()
          Returns the date of the first unsuccessful observation.
 HistoryAware.Pick getFirstPick()
          Returns the first pick.
 HistoryAware.Pick getFirstSuccess()
          Returns the HistoryAware.Pick of the first successful observation.
 HistoryAware.Pick getLastFailure()
          Returns the date of the last unsuccessful observation.
 HistoryAware.Pick getLastPick()
          Returns the last pick.
 HistoryAware.Pick getLastSuccess()
          Returns the date of the last successful observation.
 HistoryAware.Pick getPick(int nr)
          Returns the pick with the given index or null if non-defined.
 int getPickCount()
          Returns the number of picks currently stored in the history.
 Date getSubmitted()
          Returns the date the target was submitted.
 HistoryAware.Pick getSuccess(int nr)
          Returns the pick of the specified successful observation.
 int getSuccessCount()
          Returns the number of already successfully performed observations of the target.
 boolean isProgramCompleted()
          Returns true if the program was completed.
 
Methods inherited from interface stella.Handable
errorDaughter, errorMain, errorSuccessor, isEnabled, isFinished, isNotify, isPicked, setEnabled, setFinished, setPicked
 
Methods inherited from interface stella.TargetDefinition
getDaughters, getDescription, getDescriptionID, getEmailAddresses, getImageType, getInstitution, getName, getPrecursor, getSuccessor, getTargetResource, getTargetSpecific, getTeam, getTitle, getType, getUser, setPrecursor
 

Method Detail

getSubmitted

Date getSubmitted()
Returns the date the target was submitted. If this is unknown, Date(0) should be returned.


addExecution

void addExecution(ParameterClustering set,
                  Date start,
                  long dur,
                  String unique,
                  String comment)
Adds an execution to the target. Errors occured during the life-time of the target in the observation have been reported to the target using the various error... methods in the super interface.
This method should always be called from the MasterMind

Parameters:
start - The actual observation start.
dur - The duration of target observation, ms.
data - The URL of the observation data.
comment - An optional comment.

isProgramCompleted

boolean isProgramCompleted()
Returns true if the program was completed.


getEntireHistory

List<HistoryAware.Pick> getEntireHistory()
Returns a list of all observations stored in the document. The entries are HistoryAware.Pick instances. The list is ordered in a sense that older picks are earlier in the list. This is in contrast to the getPick(int) and other methods, where the index runs from the most recent pick backwards. This is a consequence of the List.add method.


getPickCount

int getPickCount()
Returns the number of picks currently stored in the history.


getPick

HistoryAware.Pick getPick(int nr)
Returns the pick with the given index or null if non-defined. Note that index-numbering is reversed, meaning that zero returns the most current pick.


getFirstPick

HistoryAware.Pick getFirstPick()
Returns the first pick. Note that this method only returns the first successful pick the target is aware of. If a maximum number of picks is specified, the pick returned by this method may change if the history is full.


getLastPick

HistoryAware.Pick getLastPick()
Returns the last pick.


getSuccessCount

int getSuccessCount()
Returns the number of already successfully performed observations of the target.


getFirstSuccess

HistoryAware.Pick getFirstSuccess()
Returns the HistoryAware.Pick of the first successful observation. Note that this method only returns the first successful pick the target is aware of. If a maximum number of picks is specified, the pick returned by this method may change if the history is full.

Returns:
Null if no successful observation has been made.

getLastSuccess

HistoryAware.Pick getLastSuccess()
Returns the date of the last successful observation. Note that this method does not define if this means the beginning, end, or some time inbetween the observation.

Returns:
Null if no successful observation has been made.

getSuccess

HistoryAware.Pick getSuccess(int nr)
Returns the pick of the specified successful observation. Note that index-numbering is reversed, meaning that zero returns the most current pick.

Parameters:
nr - The index of the queried observation. Numbering starts with zero.
Returns:
Null if no successful observation with the specified index exists.

getFailureCount

int getFailureCount()
Returns the number of unsuccessfully performed observations of the target.


getFirstFailure

HistoryAware.Pick getFirstFailure()
Returns the date of the first unsuccessful observation. Note that this method does not define if this means the beginning, end, or some time inbetween the observation.
Note that this method only returns the first successful pick the target is aware of. If a maximum number of picks is specified, the pick returned by this method may change if the history is full.

Returns:
Null if no unsuccessful observation has been made.

getLastFailure

HistoryAware.Pick getLastFailure()
Returns the date of the last unsuccessful observation. Note that this method does not define if this means the beginning, end, or some time inbetween the observation.

Returns:
Null if no unsuccessful observation has been made.

getFailure

HistoryAware.Pick getFailure(int nr)
Returns the date of the specified unsuccessful observation. Note that index-numbering is reversed, meaning that zero returns the most current pick.

Parameters:
nr - The index of the queried observation. Numbering starts with zero.
Returns:
Null if no unsuccessful observation with the specified index exists.