Module JNISpice
Package spice.basic

Class KernelVarStringComponent


  • public class KernelVarStringComponent
    extends java.lang.Object
    Class KernelVarStringComponent represents components of continued string values associated with kernel variables.

    This class is used by JNISpice to package components of continued kernel pool string variables and corresponding "found" flags. User applications normally will not need to construct instances of this class.

    This class supports fetching string components using a "found flag," as opposed to using the exception handling system to respond to an attempt to fetch a non-existent component.

    Version 1.0.0 08-JAN-2010 (NJB)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean found  
      private int index  
      private java.lang.String kervarName  
      private java.lang.String value  
    • Constructor Summary

      Constructors 
      Constructor Description
      KernelVarStringComponent​(java.lang.String kervarName, int index, java.lang.String componentValue, boolean found)
      Create a KernelVarStringComponent from a string and a boolean value indicating whether the requested component was found.
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getComponent()
      Return the String component from this instance.This method should only be called after confirming the existence of the component.
      int getIndex()
      Return the index at which this component resides, if the component exists.This index is that supplied by the caller of the constructor that created this instance; it doesn't necessarily corresponding to an extant kernel variable component.
      java.lang.String getKerVarName()
      Return the name of the kernel variable to which this component belongs.
      boolean wasFound()
      Indicate whether the component associated with this instance exists.Normally user applications should call this method to verify the existence of a kernel variable string component before attempting to retrieve the component.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • kervarName

        private java.lang.String kervarName
      • index

        private int index
      • value

        private java.lang.String value
      • found

        private boolean found
    • Constructor Detail

      • KernelVarStringComponent

        public KernelVarStringComponent​(java.lang.String kervarName,
                                        int index,
                                        java.lang.String componentValue,
                                        boolean found)
        Create a KernelVarStringComponent from a string and a boolean value indicating whether the requested component was found.
        Parameters:
        kervarName - String
        found - boolean
        index - int
        componentValue - String
    • Method Detail

      • wasFound

        public boolean wasFound()
        Indicate whether the component associated with this instance exists.Normally user applications should call this method to verify the existence of a kernel variable string component before attempting to retrieve the component.
        Returns:
        boolean
      • getComponent

        public java.lang.String getComponent()
                                      throws SpiceException
        Return the String component from this instance.This method should only be called after confirming the existence of the component.
        Returns:
        String
        Throws:
        SpiceException - exception
      • getKerVarName

        public java.lang.String getKerVarName()
        Return the name of the kernel variable to which this component belongs.
        Returns:
        String
      • getIndex

        public int getIndex()
        Return the index at which this component resides, if the component exists.This index is that supplied by the caller of the constructor that created this instance; it doesn't necessarily corresponding to an extant kernel variable component.
        Returns:
        int