jpl.mipl.mars.rmc.util
Class Solution

java.lang.Object
  extended by jpl.mipl.mars.rmc.util.RmcElement
      extended by jpl.mipl.mars.rmc.util.Solution
All Implemented Interfaces:
Comparable

public class Solution
extends RmcElement

Purpose: Implementation of Solution tag from RMC file.


   Copyright 2003, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2003.
   
============================================================================ Modification History : ---------------------- Date Who What ---------------------------------------------------------------------------- 06/06/2003 Nick Initial Release 11/29/2007 Nick Added effective and actual SCLK attributes ============================================================================

Version:
1.0
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
protected  String actualSclk
           
protected  String addDate
           
protected  Derivation derivation
           
static int DRIVE_INDEX
           
protected  String effectiveSclk
           
static int HGA_INDEX
           
protected  String id
           
static int IDD_INDEX
           
protected  String name
           
protected  String[] offset
           
protected  String[] orientation
           
static int PMA_INDEX
           
protected  List referenceFrameIndices
           
protected  String referenceFrameName
           
static int SITE_INDEX
           
protected  List solutionIndices
           
 
Constructor Summary
Solution()
          Default constructor.
Solution(Element node)
          Constructor.
Solution(String xml)
          Constructor
Solution(String id, String name, String addDate, List solIndices, String refFrameName, List refFrameIndices, String[] offset, String[] orientation, Derivation derivation)
          Constructor
Solution(String id, String name, String addDate, List solIndices, String refFrameName, List refFrameIndices, String[] offset, String[] orientation, Derivation derivation, String actualSclk, String effectiveSclk)
          Constructor
 
Method Summary
protected  boolean actualSclkIsDefined()
          Predicate test for actual SCLK
 void clearReferenceFrameIndicesFrom(int index)
          Remove indices starting at index parameter and greater.
 void clearSolutionIndicesFrom(int index)
          Remove indices starting at index parameter and greater.
 int compareTo(Object obj)
          Compares this object with the specified object for order.
protected  boolean derivationIsDefined()
          Predicate test for derivation
protected  boolean effectiveSclkIsDefined()
          Predicate test for effective SCLK
 boolean equals(Object obj)
          Implementation of the equals() method.
 String getActualSclk()
          Returns the actual SCLK value of this solution
 String getAddDate()
          Returns the date the solution was added.
 Derivation getDerivation()
          Returns the derivation object of the solution.
 String getEffectiveSclk()
          Returns the effective SCLK value of this solution
 String getId()
          Returns the id of the solution.
 String getName()
          Returns the name of the solution.
 String getOffsetX()
          Returns the x-offset of the solution.
 String getOffsetY()
          Returns the y-offset of the solution.
 String getOffsetZ()
          Returns the z-offset of the solution.
 String getOrientationS()
          Returns the s quaternion position of the solution.
 String getOrientationV1()
          Returns the v1 quaternion position of the solution.
 String getOrientationV2()
          Returns the v2 quaternion position of the solution.
 String getOrientationV3()
          Returns the v3 quaternion position of the solution.
 String getReferenceFrameIndex(int index)
          Get value for a solution index as specified by the parameter.
 List getReferenceFrameIndices()
          Returns the reference frame RMC of the solution.
 int getReferenceFrameIndicesSize()
          Return the number of reference frame indices specified for this solution RMC
 String getReferenceFrameName()
          Returns the reference frame name of the solution.
 String getSolutionIndex(int index)
          Get value for a solution index as specified by the parameter.
 List getSolutionIndices()
          Returns the RMC of the solution.
 int getSolutionIndicesSize()
          Return the number of indices specified for this solution RMC
 boolean offsetIsDefined()
          Predicate test for offset
 boolean orientationIsDefined()
          Predicate test for orientation
protected  void parseCSElement(Element node)
           
protected  void parseSolutionElement(Element node)
           
 void setActualSclk(String actSclk)
          Sets the actual SCLK of the solution.
 void setAddDate(String addDate)
          Sets the add date of the solution.
 void setDerivation(Derivation derivation)
          Sets the derivation of the solution.
 void setEffectiveSclk(String effSclk)
          Sets the effective SCLK of the solution.
 void setId(String id)
          Sets the id of the solution.
 void setName(String name)
          Sets the name of the solution.
 void setOffset(String[] offset)
          Sets the offset of the solution.
 void setOffsetX(String offsetX)
          Sets the x-offset of the solution.
 void setOffsetY(String offsetY)
          Sets the y-offset of the solution.
 void setOffsetZ(String offsetZ)
          Sets the z-offset of the solution.
 void setOrientation(String[] orientation)
          Sets the orientation of the solution.
 void setOrientationS(String orientationS)
          Sets the s quaternion position of the solution.
 void setOrientationV1(String orientationV1)
          Sets the v1 quaternion position of the solution.
 void setOrientationV2(String orientationV2)
          Sets the v2 quaternion position of the solution.
 void setOrientationV3(String orientationV3)
          Sets the v3 quaternion position of the solution.
 void setReferenceFrameIndices(List referenceFrameIndices)
          Sets the name of the solution.
 void setReferenceFrameName(String referenceFrameName)
          Sets the reference frame name of the solution.
 void setSolutionIndices(List solutionIndices)
          Sets the RMC of the solution.
 Element toDOM()
          Returns a DOM tree structure of a Solution element including nested elements.
 String toString()
          Prints this object's id, name, and RMC
 String toXML()
          Returns an XML-formatted string of this object.
 
Methods inherited from class jpl.mipl.mars.rmc.util.RmcElement
createEmptyDocument
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected String id

name

protected String name

addDate

protected String addDate

solutionIndices

protected List solutionIndices

referenceFrameName

protected String referenceFrameName

referenceFrameIndices

protected List referenceFrameIndices

offset

protected String[] offset

orientation

protected String[] orientation

derivation

protected Derivation derivation

actualSclk

protected String actualSclk

effectiveSclk

protected String effectiveSclk

SITE_INDEX

public static final int SITE_INDEX
See Also:
Constant Field Values

DRIVE_INDEX

public static final int DRIVE_INDEX
See Also:
Constant Field Values

IDD_INDEX

public static final int IDD_INDEX
See Also:
Constant Field Values

PMA_INDEX

public static final int PMA_INDEX
See Also:
Constant Field Values

HGA_INDEX

public static final int HGA_INDEX
See Also:
Constant Field Values
Constructor Detail

Solution

public Solution()
Default constructor.


Solution

public Solution(String xml)
Constructor

Parameters:
xml - String representation of the XML element Solution

Solution

public Solution(String id,
                String name,
                String addDate,
                List solIndices,
                String refFrameName,
                List refFrameIndices,
                String[] offset,
                String[] orientation,
                Derivation derivation,
                String actualSclk,
                String effectiveSclk)
Constructor

Parameters:
id - Solution id.
name - Solution name.
addDate - Date of solution creation (format: yyyy-MM-ddTHH:mm:ssZ)
solIndices - A list of the RMC values.
refFrameName - Name of the reference frame
refFrameIndices - RMC of the reference frame
offset - String array of length 3 containing x,y,z offsets
orientation - String array of length 4 containing s,v1,v2,v3 quaternion values
derivation - Reference to Derivation object, null if none
actualSclk - Actual space-craft clock value (SCLK)
effectiveSclk - Effective space-craft clock value (SCLK)

Solution

public Solution(String id,
                String name,
                String addDate,
                List solIndices,
                String refFrameName,
                List refFrameIndices,
                String[] offset,
                String[] orientation,
                Derivation derivation)
Constructor

Parameters:
id - Solution id.
name - Solution name.
addDate - Date of solution creation (format: yyyy-MM-ddTHH:mm:ssZ)
solIndices - A list of the RMC values.
refFrameName - Name of the reference frame
refFrameIndices - RMC of the reference frame
offset - String array of length 3 containing x,y,z offsets
orientation - String array of length 4 containing s,v1,v2,v3 quaternion values
derivation - Reference to Derivation object, null if none

Solution

public Solution(Element node)
Constructor.

Parameters:
node - DOM Element of type (i) GROUP from EDR metadata DOM, (ii) PROPERTY from metadata DOM, or (iii) solution (copy constructor).
Method Detail

parseSolutionElement

protected void parseSolutionElement(Element node)

parseCSElement

protected void parseCSElement(Element node)

getName

public String getName()
Returns the name of the solution.

Returns:
Name of the solution

setName

public void setName(String name)
Sets the name of the solution.

Parameters:
name - Name of the solution

getId

public String getId()
Returns the id of the solution.

Returns:
Id of the solution

setId

public void setId(String id)
Sets the id of the solution.

Parameters:
id - Id of the solution

getAddDate

public String getAddDate()
Returns the date the solution was added.

Returns:
Add date of the solution (format: yyyy-MM-ddTHH:mm:ssZ)

setAddDate

public void setAddDate(String addDate)
Sets the add date of the solution.

Parameters:
addDate - Add date of the solution (format: yyyy-MM-ddTHH:mm:ssZ)

getSolutionIndices

public List getSolutionIndices()
Returns the RMC of the solution.

Returns:
RMC of the solution as a list

getSolutionIndicesSize

public int getSolutionIndicesSize()
Return the number of indices specified for this solution RMC

Returns:
Number of indices specified for this solution RMC

getSolutionIndex

public String getSolutionIndex(int index)
Get value for a solution index as specified by the parameter.

Parameters:
index - Subscript of the index value starting from 1.
Returns:
Value associated with the index parameter of this solution RMC

clearSolutionIndicesFrom

public void clearSolutionIndicesFrom(int index)
Remove indices starting at index parameter and greater. For use with clearing out trailing section of an RMC

Parameters:
index - Index at which reseting will begin.

setSolutionIndices

public void setSolutionIndices(List solutionIndices)
Sets the RMC of the solution.

Parameters:
solutionIndices - List of the RMC values of the solution

getReferenceFrameName

public String getReferenceFrameName()
Returns the reference frame name of the solution.

Returns:
Reference frame name of the solution

setReferenceFrameName

public void setReferenceFrameName(String referenceFrameName)
Sets the reference frame name of the solution.

Parameters:
referenceFrameName - Reference frame name of the solution

getReferenceFrameIndicesSize

public int getReferenceFrameIndicesSize()
Return the number of reference frame indices specified for this solution RMC

Returns:
Number of reference frame indices specified for this solution RMC

getReferenceFrameIndices

public List getReferenceFrameIndices()
Returns the reference frame RMC of the solution.

Returns:
Reference frame RMC of the solution as a list

setReferenceFrameIndices

public void setReferenceFrameIndices(List referenceFrameIndices)
Sets the name of the solution.

Parameters:
name - Name of the solution

getReferenceFrameIndex

public String getReferenceFrameIndex(int index)
Get value for a solution index as specified by the parameter.

Parameters:
index - Subscript of the index value starting from 1.
Returns:
Value associated with the index parameter of this solution RMC

clearReferenceFrameIndicesFrom

public void clearReferenceFrameIndicesFrom(int index)
Remove indices starting at index parameter and greater. For use with clearing out trailing section of an RMC


setOffset

public void setOffset(String[] offset)
Sets the offset of the solution.

Parameters:
offset - String array of length 3 of the offset of the solution

getOffsetX

public String getOffsetX()
Returns the x-offset of the solution.

Returns:
X offset of the solution

setOffsetX

public void setOffsetX(String offsetX)
Sets the x-offset of the solution.

Parameters:
offsetX - X-offset of the solution

getOffsetY

public String getOffsetY()
Returns the y-offset of the solution.

Returns:
Y offset of the solution

setOffsetY

public void setOffsetY(String offsetY)
Sets the y-offset of the solution.

Parameters:
offsetY - Y-offset of the solution

getOffsetZ

public String getOffsetZ()
Returns the z-offset of the solution.

Returns:
Z offset of the solution

setOffsetZ

public void setOffsetZ(String offsetZ)
Sets the z-offset of the solution.

Parameters:
offsetZ - Z-offset of the solution

setOrientation

public void setOrientation(String[] orientation)
Sets the orientation of the solution.

Parameters:
offset - String array of length 4 of the orientation of the solution

getOrientationS

public String getOrientationS()
Returns the s quaternion position of the solution.

Returns:
S-quaternion position of the solution

setOrientationS

public void setOrientationS(String orientationS)
Sets the s quaternion position of the solution.

Parameters:
orientationS - S-quaternion position of the solution

getOrientationV1

public String getOrientationV1()
Returns the v1 quaternion position of the solution.

Returns:
V1-quaternion position of the solution

setOrientationV1

public void setOrientationV1(String orientationV1)
Sets the v1 quaternion position of the solution.

Parameters:
orientationV1 - V1-quaternion position of the solution

getOrientationV2

public String getOrientationV2()
Returns the v2 quaternion position of the solution.

Returns:
V2-quaternion position of the solution

setOrientationV2

public void setOrientationV2(String orientationV2)
Sets the v2 quaternion position of the solution.

Parameters:
orientationV2 - V2-quaternion position of the solution

getOrientationV3

public String getOrientationV3()
Returns the v3 quaternion position of the solution.

Returns:
V3-quaternion position of the solution

setOrientationV3

public void setOrientationV3(String orientationV3)
Sets the v3 quaternion position of the solution.

Parameters:
orientationV3 - V3-quaternion position of the solution

setDerivation

public void setDerivation(Derivation derivation)
Sets the derivation of the solution.

Parameters:
derivation - Derivation of the solution

getDerivation

public Derivation getDerivation()
Returns the derivation object of the solution.

Returns:
Derivation of the solution

setActualSclk

public void setActualSclk(String actSclk)
Sets the actual SCLK of the solution.

Parameters:
actSclk - effective SCLK

getActualSclk

public String getActualSclk()
Returns the actual SCLK value of this solution

Returns:
Actual SCLK

setEffectiveSclk

public void setEffectiveSclk(String effSclk)
Sets the effective SCLK of the solution.

Parameters:
effSclk - effective SCLK

getEffectiveSclk

public String getEffectiveSclk()
Returns the effective SCLK value of this solution

Returns:
Effective SCLK

offsetIsDefined

public boolean offsetIsDefined()
Predicate test for offset

Returns:
True if offset is defined in this solution, false otherwise

orientationIsDefined

public boolean orientationIsDefined()
Predicate test for orientation

Returns:
True if orientation is defined in this solution, false otherwise

derivationIsDefined

protected boolean derivationIsDefined()
Predicate test for derivation

Returns:
True if derivation is defined in this solution, false otherwise

actualSclkIsDefined

protected boolean actualSclkIsDefined()
Predicate test for actual SCLK

Returns:
True if actual SCLK is defined in this solution, false otherwise

effectiveSclkIsDefined

protected boolean effectiveSclkIsDefined()
Predicate test for effective SCLK

Returns:
True if effective SCLK is defined in this solution, false otherwise

toXML

public String toXML()
Returns an XML-formatted string of this object.

Specified by:
toXML in class RmcElement
Returns:
XML-formatted string of solution data

toDOM

public Element toDOM()
Returns a DOM tree structure of a Solution element including nested elements.

Specified by:
toDOM in class RmcElement
Returns:
Element node representation of this object.

compareTo

public int compareTo(Object obj)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Examines RMC first, if equals, then compares ids. 'telemtry' is set to come before all other ids, otherwise compares ids alphabetically.

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class RmcElement
Parameters:
obj - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equals

public boolean equals(Object obj)
Implementation of the equals() method.

Overrides:
equals in class Object
Parameters:
the - Object to be compared
Returns:
True if compareTo(obj) returns 0, false otherwise.

toString

public String toString()
Prints this object's id, name, and RMC

Overrides:
toString in class Object
Returns:
String representation of this object