S-PLUS Connect/Java v1.0

com.insightful.splus
Class SplusDataResult

java.lang.Object
  extended bycom.insightful.splus.SplusDataResult
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SplusBooleanDataResult, SplusByteDataResult, SplusDoubleDataResult, SplusFloatDataResult, SplusLongDataResult, SplusStringDataResult

public class SplusDataResult
extends Object
implements Serializable

Result information from a query to the S-PLUS engine.

See Also:
Serialized Form

Constructor Summary
SplusDataResult(String out, String err, String expr, String[] warn)
          Create a result with no data.
 
Method Summary
 boolean[] getBooleanData()
          Get the data as booleans.
 byte[] getByteData()
          Get the data as bytes.
 Object getData()
          Get the data as an Object.
 double[] getDoubleData()
          Get the data as doubles.
 String getError()
          Get the error message.
 String getExpression()
          Get the expression evaluated, formatted to the same width as the output.
 float[] getFloatData()
          Get the data as floats.
 long[] getLongData()
          Get the data as longs.
 String getOutput()
          Get the text output that would be printed to standard out.
 String[] getStringData()
          Get the data as Strings.
 String[] getWarning()
          Get the warning messages.
 boolean hasError()
          Test whether there is an error message.
 boolean hasExpression()
          Test whether there is an expression.
 boolean hasOutput()
          Test whether there is any text output.
 boolean hasWarning()
          Test whether there are any warnings.
static void main(String[] args)
          Run the unit test.
static int unit_test()
          Routine for unit testing of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplusDataResult

public SplusDataResult(String out,
                       String err,
                       String expr,
                       String[] warn)
Create a result with no data. This is produced when there is an error evaluating the expression, or the expression produces an empty or NULL result.

Method Detail

getData

public Object getData()
Get the data as an Object. Returns null for the plain SplusDataResult and an array of primitives for the classes extending SplusDataResult.


getOutput

public String getOutput()
Get the text output that would be printed to standard out.


getError

public String getError()
Get the error message.


getExpression

public String getExpression()
Get the expression evaluated, formatted to the same width as the output.


getWarning

public String[] getWarning()
Get the warning messages.


hasOutput

public boolean hasOutput()
Test whether there is any text output.


hasError

public boolean hasError()
Test whether there is an error message.


hasExpression

public boolean hasExpression()
Test whether there is an expression.


hasWarning

public boolean hasWarning()
Test whether there are any warnings.


getDoubleData

public double[] getDoubleData()
                       throws SplusBadDataException
Get the data as doubles. If the expression did not generate doubles, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

getBooleanData

public boolean[] getBooleanData()
                         throws SplusBadDataException
Get the data as booleans. If the expression did not generate booleans, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

getStringData

public String[] getStringData()
                       throws SplusBadDataException
Get the data as Strings. If the expression did not generate Strings, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

getLongData

public long[] getLongData()
                   throws SplusBadDataException
Get the data as longs. If the expression did not generate longs, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

getFloatData

public float[] getFloatData()
                     throws SplusBadDataException
Get the data as floats. If the expression did not generate floats, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

getByteData

public byte[] getByteData()
                   throws SplusBadDataException
Get the data as bytes. If the expression did not generate bytes, this method generates an SplusBadDataException.

Throws:
SplusBadDataException

unit_test

public static int unit_test()
Routine for unit testing of this class.


main

public static void main(String[] args)
Run the unit test.


S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.