JNISpice
version 2.0.0

spice.basic
Class Surface

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

public class Surface
extends java.lang.Object

Class Surface is used to represent identities of surfaces associated with ephemeris objects.

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

Each Surface is associated with a Body. Surface ID-name mappings associated with a given Body are distinct from those associated with another Body: Bodies can be thought of as identifying name spaces for Surface ID codes and names. A set consisting of a Surface ID code and a Body can be mapped to a Surface name, and a set consisting of a Surface name and a Body can be mapped to a Surface ID code.

Version 1.0.0 26-DEC-2016 (NJB)


Constructor Summary
Surface()
          No-arguments constructor.
Surface(int code, Body body)
          Construct a Surface from an integer code and an associated Body.
Surface(java.lang.String name, Body body)
          Construct a Surface from a surface name and an associated Body.
Surface(Surface s)
          Construct a Surface from another Surface.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Test two Surfaces for equality.
 Body getBody()
          Return the body associated with this surface.
 int getIDCode()
          Return NAIF ID code associated with a Surface.
 java.lang.String getName()
          Return name associated with a Surface.
 int hashCode()
          Return a hash code for this Surface.
 java.lang.String toString()
          Return surface name in String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Surface

public Surface()
No-arguments constructor. This constructor creates an uninitialized Surface instance.


Surface

public Surface(java.lang.String name,
               Body body)
        throws SpiceException
Construct a Surface from a surface name and an associated Body.

Throws:
SpiceException

Surface

public Surface(int code,
               Body body)
        throws SpiceException
Construct a Surface from an integer code and an associated Body.

Throws:
SpiceException

Surface

public Surface(Surface s)
        throws SpiceException
Construct a Surface from another Surface. This constructor creates a deep copy.

Throws:
SpiceException
Method Detail

getIDCode

public int getIDCode()
              throws IDCodeNotFoundException,
                     SpiceException
Return NAIF ID code associated with a Surface.

Throws:
IDCodeNotFoundException
SpiceException

getName

public java.lang.String getName()
                         throws SpiceException
Return name associated with a Surface.

Throws:
SpiceException

getBody

public Body getBody()
             throws SpiceException
Return the body associated with this surface. This method returns a deep copy.

Throws:
SpiceException

toString

public java.lang.String toString()
Return surface 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

equals

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

The integer codes of the surfaces and associated bodies are used for the comparison.

Overrides:
equals in class java.lang.Object

hashCode

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

Hash codes are not necessarily distinct for distinct surfaces.

Note that this method can't throw a SpiceException.

Overrides:
hashCode in class java.lang.Object

JNISpice
version 2.0.0

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