JNISpice
version 2.0.0

spice.basic
Class KernelPool

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

public class KernelPool
extends java.lang.Object

Class KernelPool supports access to the kernel pool data structure.

Version 1.0.0 08-JAN-2010 (NJB)


Field Summary
static int CHARACTER
           
static java.lang.String CSPICE_CHARACTER
           
static java.lang.String CSPICE_NUMERIC
           
static int NUMERIC
           
 
Constructor Summary
KernelPool()
           
 
Method Summary
static boolean checkWatch(java.lang.String agent)
          Determine whether any of the kernel variables associated with a specified agent have been updated.
static void clear()
          Clear the kernel pool.
static void delete(java.lang.String name)
          Delete a variable from the kernel pool.
static boolean exists(java.lang.String name)
          Indicate whether a kernel variable of a given name exists.
static boolean exists(java.lang.String name, int dataType)
          Indicate whether a kernel variable of a given name and data type exists.
static KernelVarDescriptor getAttributes(java.lang.String name)
          Get the attributes of a kernel variable specified by name.
static java.lang.String[] getCharacter(java.lang.String name)
          Fetch a character kernel variable.
static java.lang.String[] getCharacter(java.lang.String name, int start, int room)
          Fetch a slice (a contiguous sequence of array elements) of a character kernel variable.
static int getDataType(java.lang.String name)
          Get the data type of a specified kernel variable.
static double[] getDouble(java.lang.String name)
          Fetch a double precision kernel variable.
static double[] getDouble(java.lang.String name, int start, int room)
          Fetch a slice (a contiguous sequence of array elements) of a double precision kernel variable.
static int[] getInteger(java.lang.String name)
          Fetch an integer kernel variable.
static int[] getInteger(java.lang.String name, int start, int room)
          Fetch a slice (a contiguous sequence of array elements) of an integer kernel variable.
static java.lang.String[] getNames(java.lang.String template)
          Retrieve an array containing all names of kernel variables that match a given template.
static java.lang.String[] getNames(java.lang.String template, int start, int room)
          Retrieve a slice of an array containing all names of kernel variables that match a given template.
static int getParameter(java.lang.String name)
          Return kernel pool size parameters specified by name.
static int getSize(java.lang.String name)
          Get the size of a specified kernel variable.
static KernelVarStringComponent getStringComponent(java.lang.String name, int nth, java.lang.String contin)
          Return a component of a string value from the kernel pool.
static void load(java.lang.String name)
          Load a text kernel into the kernel pool.
static void loadFromBuffer(java.lang.String[] cvals)
          Load into the kernel pool variables defined by "keyword=value" assignments in a string array.
static void putCharacter(java.lang.String name, java.lang.String[] values)
          Insert a character kernel variable into the kernel pool.
static void putDouble(java.lang.String name, double[] values)
          Insert a double precision kernel variable into the kernel pool.
static void putInteger(java.lang.String name, int[] values)
          Insert an integer kernel variable into the kernel pool.
static void setWatch(java.lang.String agent, java.lang.String[] names)
          Associate an agent with a set of kernel variables to be watched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARACTER

public static final int CHARACTER
See Also:
Constant Field Values

NUMERIC

public static final int NUMERIC
See Also:
Constant Field Values

CSPICE_CHARACTER

public static final java.lang.String CSPICE_CHARACTER
See Also:
Constant Field Values

CSPICE_NUMERIC

public static final java.lang.String CSPICE_NUMERIC
See Also:
Constant Field Values
Constructor Detail

KernelPool

public KernelPool()
Method Detail

getAttributes

public static KernelVarDescriptor getAttributes(java.lang.String name)
                                         throws SpiceException
Get the attributes of a kernel variable specified by name.

Throws:
SpiceException

exists

public static boolean exists(java.lang.String name,
                             int dataType)
                      throws SpiceException
Indicate whether a kernel variable of a given name and data type exists.

Note that this functionality differs from that of the CSPICE routine `expool_c', which is restricted to numeric kernel variables.

Throws:
SpiceException

exists

public static boolean exists(java.lang.String name)
                      throws SpiceException
Indicate whether a kernel variable of a given name exists.

Note that this functionality differs from that of the CSPICE routine `expool_c', which is restricted to numeric kernel variables.

Throws:
SpiceException

getDataType

public static int getDataType(java.lang.String name)
                       throws SpiceException,
                              KernelVarNotFoundException
Get the data type of a specified kernel variable.

Throws:
SpiceException
KernelVarNotFoundException

getSize

public static int getSize(java.lang.String name)
                   throws SpiceException,
                          KernelVarNotFoundException
Get the size of a specified kernel variable.

Throws:
SpiceException
KernelVarNotFoundException

getCharacter

public static java.lang.String[] getCharacter(java.lang.String name)
                                       throws SpiceException,
                                              KernelVarNotFoundException
Fetch a character kernel variable.

To obtain a slice of a character kernel variable, see the method getCharacter( String name, int start, int room ).

Throws:
SpiceException
KernelVarNotFoundException

getCharacter

public static java.lang.String[] getCharacter(java.lang.String name,
                                              int start,
                                              int room)
                                       throws SpiceException,
                                              KernelVarNotFoundException
Fetch a slice (a contiguous sequence of array elements) of a character kernel variable.

To obtain an entire character kernel variable in one call. see the method getCharacter( String name ).

Throws:
SpiceException
KernelVarNotFoundException

getStringComponent

public static KernelVarStringComponent getStringComponent(java.lang.String name,
                                                          int nth,
                                                          java.lang.String contin)
                                                   throws SpiceException
Return a component of a string value from the kernel pool.

This method is analgous to the CSPICE routine stpool_c.

This method treats the string array associated with a character kernel variable as a sequence of components, where each component consists of a sequence of array elements connected by continuation characters.

It is permissible for the input index not to correspond to an existing component. The returned KernelVarStringComponent instance contains a "found flag" that indicates whether the component exists.

The indices of the components are zero-based.

Throws:
SpiceException

getDouble

public static double[] getDouble(java.lang.String name)
                          throws SpiceException,
                                 KernelVarNotFoundException
Fetch a double precision kernel variable.

To obtain a slice of a double precision kernel variable, see the method getDouble( String name, int start, int room ).

Throws:
SpiceException
KernelVarNotFoundException

getDouble

public static double[] getDouble(java.lang.String name,
                                 int start,
                                 int room)
                          throws SpiceException,
                                 KernelVarNotFoundException
Fetch a slice (a contiguous sequence of array elements) of a double precision kernel variable.

To obtain an entire double precision kernel variable in one call. see the method getDouble( String name ).

Throws:
SpiceException
KernelVarNotFoundException

getInteger

public static int[] getInteger(java.lang.String name)
                        throws SpiceException,
                               KernelVarNotFoundException
Fetch an integer kernel variable.

To obtain a slice of an integer kernel variable, see the method getInteger( String name, int start, int room ).

Throws:
SpiceException
KernelVarNotFoundException

getInteger

public static int[] getInteger(java.lang.String name,
                               int start,
                               int room)
                        throws SpiceException,
                               KernelVarNotFoundException
Fetch a slice (a contiguous sequence of array elements) of an integer kernel variable.

To obtain an entire integer kernel variable in one call. see the method getInteger( String name ).

Throws:
SpiceException
KernelVarNotFoundException

putCharacter

public static void putCharacter(java.lang.String name,
                                java.lang.String[] values)
                         throws SpiceException
Insert a character kernel variable into the kernel pool.

Throws:
SpiceException

putDouble

public static void putDouble(java.lang.String name,
                             double[] values)
                      throws SpiceException
Insert a double precision kernel variable into the kernel pool.

Throws:
SpiceException

putInteger

public static void putInteger(java.lang.String name,
                              int[] values)
                       throws SpiceException
Insert an integer kernel variable into the kernel pool.

Throws:
SpiceException

loadFromBuffer

public static void loadFromBuffer(java.lang.String[] cvals)
                           throws SpiceException
Load into the kernel pool variables defined by "keyword=value" assignments in a string array.

Throws:
SpiceException

load

public static void load(java.lang.String name)
                 throws SpiceException
Load a text kernel into the kernel pool.

Caution: kernels loaded via this method are NOT loaded into the kernel database.

Throws:
SpiceException

clear

public static void clear()
                  throws SpiceException
Clear the kernel pool.

Caution: this routine should not be used together with the kernel database.

Throws:
SpiceException

getParameter

public static int getParameter(java.lang.String name)
                        throws SpiceException
Return kernel pool size parameters specified by name.
   name       is the name of a kernel pool size parameter.
              The following parameters may be specified:

              MAXVAR      is the maximum number of variables that the
                          kernel pool may contain at any one time.
                          MAXVAR should be a prime number.

              MAXLEN      is the maximum length of the variable names
                          that can be stored in the kernel pool.

              MAXVAL      is the maximum number of distinct values that
                          may belong to the variables in the kernel
                          pool.  Each variable must have at least one
                          value, and may have any number, so long as
                          the total number does not exceed MAXVAL.
                          MAXVAL must be at least as large as MAXVAR.

              MXNOTE      is the maximum number of distinct
                          variable-agents pairs that can be maintained
                          by the kernel pool.  (A variable is "paired"
                          with an agent, if that agent is to be
                          notified whenever the variable is updated.)

              MAXAGT      is the maximum number of agents that can be
                          kept on the distribution list for
                          notification of updates to kernel variables.

              MAXCHR      is the maximum number of characters that can
                          be stored in a component of a string valued
                          kernel variable.

              MAXLIN      is the maximum number of character strings
                          that can be stored as data for kernel pool
                          variables.

              Note that the case of name is insignificant.  Embedded
              blanks are also ignored.
   

Throws:
SpiceException

delete

public static void delete(java.lang.String name)
                   throws SpiceException
Delete a variable from the kernel pool.

Throws:
SpiceException

getNames

public static java.lang.String[] getNames(java.lang.String template)
                                   throws SpiceException
Retrieve an array containing all names of kernel variables that match a given template.

To obtain a slice of the array of variable names matching a template, see the method getNames( String template, int start, int room ).

Throws:
SpiceException

getNames

public static java.lang.String[] getNames(java.lang.String template,
                                          int start,
                                          int room)
                                   throws SpiceException
Retrieve a slice of an array containing all names of kernel variables that match a given template.

To obtain the full array of variable names matching a template, see the method getNames( String template).

Throws:
SpiceException

setWatch

public static void setWatch(java.lang.String agent,
                            java.lang.String[] names)
                     throws SpiceException
Associate an agent with a set of kernel variables to be watched.

Throws:
SpiceException

checkWatch

public static boolean checkWatch(java.lang.String agent)
                          throws SpiceException
Determine whether any of the kernel variables associated with a specified agent have been updated.

Throws:
SpiceException

JNISpice
version 2.0.0

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