JNISpice
version 2.0.0

spice.basic
Class DAS

java.lang.Object
  extended by spice.basic.DAS
Direct Known Subclasses:
DLA

public class DAS
extends java.lang.Object

Class DAS supports creation of and low-level read operations on DAS files.

This class supports DAS comment area read access.

See the subclass DSK for methods used to write that type of file.

Normal read access of DSK files requires that these files be loaded via KernelDatabase.load(java.lang.String). This method plays the role of the routine FURNSH in SPICELIB.

Examples

TBD

The numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation.




Author_and_Version

Version 1.0.0 10-DEC-2016 (NJB)


Field Summary
protected  java.lang.String fileName
           
protected  int handle
           
protected  boolean readable
           
protected  boolean writable
           
 
Constructor Summary
  DAS()
          No-args constructor.
  DAS(DAS das)
          Copy constructor.
  DAS(int handle)
          Construct a DAS instance from handle of an open DAS file.
protected DAS(java.lang.String fileName)
          Construct a DAS instance representing a file.
 
Method Summary
 void addComments(java.lang.String[] commentBuffer)
          Append comments to the comment area of a DAS file.
 void close()
          Close a specified DAS file, thereby freeing resources.
 void deleteComments()
          Delete comments from a DAS file.
 int getCommentCharacterCount()
          Get the number of comment characters in a DAS file.
 int getCommentRecordCount()
          Get the number of comment records in a DAS file.
 java.lang.String getFileName()
          Return the file name.
 int getHandle()
          Get file handle.
 java.lang.String getInternalFileName()
          Get the internal file name from a DAS file.
 boolean isReadable()
          Indicate whether a DAS file is readable.
 boolean isWritable()
          Indicate whether a DAS file is writable.
static DAS openForRead(java.lang.String fileName)
          Open a DAS file for write access.
static DAS openForWrite(java.lang.String fileName)
          Open a DAS file for read access.
 java.lang.String[] readComments(int lineLength)
          Read comments from an existing DAS file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

protected java.lang.String fileName

handle

protected int handle

readable

protected boolean readable

writable

protected boolean writable
Constructor Detail

DAS

protected DAS(java.lang.String fileName)
Construct a DAS instance representing a file. The file need not exist.

User applications will not need to call this constructor directly. See the methods openForRead(java.lang.String) and openForWrite(java.lang.String).


DAS

public DAS(int handle)
    throws SpiceException
Construct a DAS instance from handle of an open DAS file.

Throws:
SpiceException

DAS

public DAS(DAS das)
Copy constructor. This constructor creates a deep copy.


DAS

public DAS()
No-args constructor.

Method Detail

openForRead

public static DAS openForRead(java.lang.String fileName)
                       throws SpiceException
Open a DAS file for write access.

Throws:
SpiceException

openForWrite

public static DAS openForWrite(java.lang.String fileName)
                        throws SpiceException
Open a DAS file for read access.

Throws:
SpiceException

getHandle

public int getHandle()
              throws SpiceException
Get file handle.

Throws:
SpiceException

getFileName

public java.lang.String getFileName()
                             throws SpiceException
Return the file name.

Throws:
SpiceException

isReadable

public boolean isReadable()
Indicate whether a DAS file is readable.

A DAS file is readable if it has been opened for read OR write access.


isWritable

public boolean isWritable()
Indicate whether a DAS file is writable.


close

public void close()
           throws SpiceException
Close a specified DAS file, thereby freeing resources.

Throws:
SpiceException

addComments

public void addComments(java.lang.String[] commentBuffer)
                 throws SpiceException
Append comments to the comment area of a DAS file.

Throws:
SpiceException

deleteComments

public void deleteComments()
                    throws SpiceException
Delete comments from a DAS file.

Throws:
SpiceException

readComments

public java.lang.String[] readComments(int lineLength)
                                throws SpiceException
Read comments from an existing DAS file.

Throws:
SpiceException

getInternalFileName

public java.lang.String getInternalFileName()
                                     throws SpiceException
Get the internal file name from a DAS file.

This method initializes the internal file name field of the DAS instance and returns a deep copy of the name.

Throws:
SpiceException

getCommentRecordCount

public int getCommentRecordCount()
                          throws SpiceException
Get the number of comment records in a DAS file.

Throws:
SpiceException

getCommentCharacterCount

public int getCommentCharacterCount()
                             throws SpiceException
Get the number of comment characters in a DAS file.

Throws:
SpiceException

JNISpice
version 2.0.0

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