dsql.value
Class RecordProxy

java.lang.Object
  extended bydsql.DMExecuted
      extended bydsql.value.Value
          extended bydsql.value.NonScalarValue
              extended bydsql.value.RecordProxy
All Implemented Interfaces:
ColumnHolder, DotAt

public class RecordProxy
extends NonScalarValue
implements DotAt, ColumnHolder

A pointer to a record in a table. This class implements the DotAt interface, which means its contents can be accessed with ".@n". It also implements the ColumnHolder interface, so that it can be used in Table or set operations whenever a record is expected.


Constructor Summary
RecordProxy(TableResult _table, int _recordIndex)
           
 
Method Summary
 boolean getBoolean()
           
 java.lang.Object getColumn(int i)
           
 java.lang.Object getColumn(java.lang.String s)
           
 int getColumnCount()
           
 int getColumnDisplaySize(int i)
           
 java.lang.String getColumnLabel(int i)
           
 java.lang.String getColumnString(int i)
           
 java.lang.String getColumnString(java.lang.String s)
           
 java.lang.Object getField(int i)
          First column is 1
 java.lang.Object getField(java.lang.String name)
          Access an object's field
 ConstructedResults getMeta()
           
 java.lang.String getString()
           
protected  TableResult getTable()
           
 void print(ASTPrint printer)
          Print this value using printer
 java.lang.Object setField(int i, Value val)
           
 java.lang.String toString()
           
 void updateField()
           
 
Methods inherited from class dsql.value.NonScalarValue
getFields, isScalar, setField
 
Methods inherited from class dsql.value.Value
getFloat, getInt, getObject, getObjectClass, getRecordHolder, getType, getValue, getValue
 
Methods inherited from class dsql.DMExecuted
getCaller, setCaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecordProxy

public RecordProxy(TableResult _table,
                   int _recordIndex)
            throws ExecuteException
Method Detail

toString

public java.lang.String toString()

getString

public java.lang.String getString()
                           throws ExecuteException
Specified by:
getString in class Value
Returns:
a string representation of this value, to be used within dsql expressions. This is distinct from toString(), which is used to output the object for debugging purposes.
Throws:
ExecuteException

getBoolean

public boolean getBoolean()
                   throws ExecuteException
Specified by:
getBoolean in class Value
Returns:
true if this Value is "non-zero", e.g. non-empty string, tables has some record, etc.
Throws:
ExecuteException

print

public void print(ASTPrint printer)
           throws ExecuteException
Description copied from class: Value
Print this value using printer

Specified by:
print in class Value
Throws:
ExecuteException

getField

public java.lang.Object getField(java.lang.String name)
                          throws ExecuteException
Access an object's field

Overrides:
getField in class NonScalarValue
Throws:
ExecuteException

getField

public java.lang.Object getField(int i)
                          throws ExecuteException
Description copied from interface: DotAt
First column is 1

Specified by:
getField in interface DotAt
Throws:
ExecuteException

setField

public java.lang.Object setField(int i,
                                 Value val)
                          throws ExecuteException
Specified by:
setField in interface DotAt
Throws:
ExecuteException

updateField

public void updateField()
                 throws ExecuteException
Throws:
ExecuteException

getMeta

public ConstructedResults getMeta()
                           throws ExecuteException
Specified by:
getMeta in class Value
Returns:
meta-information about this Value, e.g. for a table, it returns the names,types,width,etc. of its columns.
Throws:
ExecuteException

getColumn

public java.lang.Object getColumn(int i)
                           throws ExecuteException
Specified by:
getColumn in interface ColumnHolder
Parameters:
i - column number (first column is 1)
Returns:
column value; usually a String, but can also be a complex object, such as XmlDataValue.
Throws:
ExecuteException

getColumnString

public java.lang.String getColumnString(int i)
                                 throws ExecuteException
Specified by:
getColumnString in interface ColumnHolder
Throws:
ExecuteException

getColumn

public java.lang.Object getColumn(java.lang.String s)
                           throws ExecuteException
Specified by:
getColumn in interface ColumnHolder
Parameters:
s - column name
Returns:
column value; usually a String, but can also be a complex object, such as XmlDataValue.
Throws:
ExecuteException

getColumnString

public java.lang.String getColumnString(java.lang.String s)
                                 throws ExecuteException
Specified by:
getColumnString in interface ColumnHolder
Throws:
ExecuteException

getColumnCount

public int getColumnCount()
                   throws ExecuteException
Specified by:
getColumnCount in interface ColumnHolder
Throws:
ExecuteException

getColumnLabel

public java.lang.String getColumnLabel(int i)
                                throws ExecuteException
Specified by:
getColumnLabel in interface ColumnHolder
Throws:
ExecuteException

getColumnDisplaySize

public int getColumnDisplaySize(int i)
                         throws ExecuteException
Specified by:
getColumnDisplaySize in interface ColumnHolder
Throws:
ExecuteException

getTable

protected TableResult getTable()
                        throws ExecuteException
Throws:
ExecuteException