JNISpice
version 2.0.0

spice.basic
Class Instrument

java.lang.Object
  extended by spice.basic.Instrument

public class Instrument
extends java.lang.Object

Class Instrument is used to represent identities of spacecraft structures or instruments.

This class takes the place of integer ID codes and instrument names used by subroutine interfaces in SPICELIB and CSPICE. However, instrument names and codes are still used to construct Instrument objects: either a name or NAIF integer code must be supplied in order to construct an Instrument.

Version 2.0.0 26-DEC-2016 (NJB)

Functional change: the getName method now returns a copy of the String value used to create the instance, if the instance was created using a name rather than an ID code. Previously the name was generated by converting the instance's name field to an integer ID, then converting the ID back to a name.

The copy constructor now uses the stored IDMap instance's deepCopy method, rather than converting the stored instance to an integer ID and using that to create a new instance.

Version 1.0.0 25-AUG-2009 (NJB)


Constructor Summary
Instrument(Instrument inst)
          Construct an Instrument from another Instrument.
Instrument(int code)
          Construct an Instrument from an integer code.
Instrument(java.lang.String name)
          Construct an Instrument from a instrument name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Test two Instruments for equality.
 int getIDCode()
          Return NAIF ID code associated with an Instrument.
 java.lang.String getName()
          Return name associated with an Instrument.
 SCLK getSCLK()
          Return SCLK ID associated with an Instrument.
 int hashCode()
          Return a hash code for this Instrument.
 java.lang.String toString()
          Return instrument name in String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Instrument

public Instrument(java.lang.String name)
           throws SpiceException
Construct an Instrument from a instrument name.

Throws:
SpiceException

Instrument

public Instrument(int code)
           throws SpiceErrorException
Construct an Instrument from an integer code.

Throws:
SpiceErrorException

Instrument

public Instrument(Instrument inst)
           throws SpiceException
Construct an Instrument from another Instrument.

Throws:
SpiceException
Method Detail

equals

public boolean equals(java.lang.Object obj)
Test two Instruments for equality.

The integer codes of the instruments are used for the comparison.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Return a hash code for this Instrument. This method overrides Object's hashcode() method.

Note that this method can't throw a SpiceException.

Overrides:
hashCode in class java.lang.Object

getIDCode

public int getIDCode()
              throws SpiceException
Return NAIF ID code associated with an Instrument.

Throws:
SpiceException

getName

public java.lang.String getName()
                         throws SpiceException
Return name associated with an Instrument.

Throws:
SpiceException

toString

public java.lang.String toString()
Return instrument name in String. This method overrides Object's toString() method. Note that this method can't throw a SpiceException.

Overrides:
toString in class java.lang.Object

getSCLK

public SCLK getSCLK()
             throws SpiceException
Return SCLK ID associated with an Instrument. The returned ID is that returned by the SPICE routine CKMETA.

Throws:
SpiceException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)