org.tranql.field
Class FieldAccessor

java.lang.Object
  extended by org.tranql.field.FieldAccessor
All Implemented Interfaces:
java.io.Serializable, FieldTransform
Direct Known Subclasses:
CacheRowAccessor

public class FieldAccessor
extends java.lang.Object
implements FieldTransform

Public accessor to a row for use at the end of a transform pipeline.

Version:
$Revision: 45 $ $Date: 2004-04-20 00:23:20 +0200 (Tue, 20 Apr 2004) $
See Also:
Serialized Form

Field Summary
protected  java.lang.Class fieldClass
           
protected  int slot
           
 
Constructor Summary
FieldAccessor(int slot, java.lang.Class fieldClass)
          Constructor specify the slot this is an accessor for.
 
Method Summary
 java.lang.Object get(Row row)
          Return a value from the supplied row.
 java.lang.Class getFieldClass()
          Return the Java Class that will be returned by fetch and that should be passed to set.
 void set(Row row, java.lang.Object value)
          Set a value into the supplied row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldClass

protected final java.lang.Class fieldClass

slot

protected final int slot
Constructor Detail

FieldAccessor

public FieldAccessor(int slot,
                     java.lang.Class fieldClass)
Constructor specify the slot this is an accessor for.

Parameters:
slot - the slot whose data this accessor manages
fieldClass - the Class of the Objects the slot will contain
Method Detail

getFieldClass

public java.lang.Class getFieldClass()
Description copied from interface: FieldTransform
Return the Java Class that will be returned by fetch and that should be passed to set.

Specified by:
getFieldClass in interface FieldTransform
Returns:
the Java Class for this field

get

public java.lang.Object get(Row row)
Return a value from the supplied row.

Specified by:
get in interface FieldTransform
Parameters:
row - the row whose data should be returned
Returns:
the value this row contains for this accessor, may be null

set

public void set(Row row,
                java.lang.Object value)
Set a value into the supplied row.

Specified by:
set in interface FieldTransform
Parameters:
row - the row whose data should be set
value - the value to store in the row, may be null


Copyright © -2010 The Codehaus. All Rights Reserved.