Module JNISpice
Package spice.basic

Class 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

      Constructors 
      Constructor Description
      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.This constructor creates a deep copy.
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Test two Surfaces for equality.
      Body getBody()
      Return the body associated with this surface.This method returns a deep copy.
      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.This method overrides Object's hashcode() method.
      java.lang.String toString()
      Return surface name in String.This method overrides Object's toString() method.
      • 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.
        Parameters:
        name -
        body -
        Throws:
        SpiceException
      • Surface

        public Surface​(int code,
                       Body body)
                throws SpiceException
        Construct a Surface from an integer code and an associated Body.
        Parameters:
        code -
        body -
        Throws:
        SpiceException
      • Surface

        public Surface​(Surface s)
                throws SpiceException
        Construct a Surface from another Surface.This constructor creates a deep copy.
        Parameters:
        s -
        Throws:
        SpiceException
    • Method Detail

      • getBody

        public Body getBody()
                     throws SpiceException
        Return the body associated with this surface.This method returns a deep copy.
        Returns:
        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
        Returns:
      • 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
        Returns:
      • 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
        Returns: