database
Class Result

java.lang.Object
  |
  +--database.Result

public class Result
extends Object

This class defines the required methods for Database method results objects. It encapsulates among other things byte-arrays as objects.

Version:
$Id: Result.java,v 1.1.1.2 2002/05/08 22:48:28 tep Exp $
Author:
Per Harald Myrvang <perm@pasta.cs.uit.no>

Field Summary
private static String __me
           
private  byte[] ba
           
private  Object obj
           
private  boolean val
           
 
Constructor Summary
Result(boolean valid, Object obj, byte[] ba)
          Construct a result-object, explicitly setting validity.
Result(Object obj, byte[] ba)
          Construct a result-object, inferring validity.
 
Method Summary
 byte[] getBytes()
          Returns the byte array representation of this object
 Object getObject()
          Returns any Object associated with this result, or null.
 ResultSet getResultSet()
          Returns any ResultSet associated with the result, or null.
 boolean isObject()
          Returns true if this result contains a valid Object reference.
 String toString()
          Returns the String representation of this object.
 boolean valid()
          Returns true if this result object is valid.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

__me

private static String __me

val

private boolean val

ba

private byte[] ba

obj

private Object obj
Constructor Detail

Result

public Result(Object obj,
              byte[] ba)
Construct a result-object, inferring validity. A object is considered valid if one or more of the args are non-null.
Parameters:
obj - non-null if this result is represented by an object.
ba - non-null if this result is represented by a byte-array.

Result

public Result(boolean valid,
              Object obj,
              byte[] ba)
Construct a result-object, explicitly setting validity.
Parameters:
valid - true if this object represent a valid result.
obj - non-null if this result is represented by an object.
ba - non-null if this result is represented by a byte-array.
Method Detail

valid

public boolean valid()
Returns true if this result object is valid.

toString

public String toString()
Returns the String representation of this object.
Overrides:
toString in class Object

getBytes

public byte[] getBytes()
Returns the byte array representation of this object

isObject

public boolean isObject()
Returns true if this result contains a valid Object reference.

getObject

public Object getObject()
Returns any Object associated with this result, or null.

getResultSet

public ResultSet getResultSet()
Returns any ResultSet associated with the result, or null.