org.datanucleus.store.fieldmanager
Class SingleTypeFieldManager

java.lang.Object
  extended by org.datanucleus.store.fieldmanager.SingleTypeFieldManager
All Implemented Interfaces:
FieldConsumer, FieldManager, FieldSupplier

public class SingleTypeFieldManager
extends java.lang.Object
implements FieldManager

A simple field manager that stores/fetches a single field value per type in memory.

Calls to the store methods save the value in a local field; calls to the fetch methods return the previously stored value for that type, or the "empty" default value if nothing has been stored.

The field number arguments to each method are ignored.

Version:
$Revision: 1.2 $

Constructor Summary
SingleTypeFieldManager()
          Default Constructor.
SingleTypeFieldManager(boolean booleanValue)
          Constructor.
SingleTypeFieldManager(byte byteValue)
          Constructor.
SingleTypeFieldManager(char charValue)
          Constructor.
SingleTypeFieldManager(double doubleValue)
          Constructor.
SingleTypeFieldManager(float floatValue)
          Constructor.
SingleTypeFieldManager(int intValue)
          Constructor.
SingleTypeFieldManager(long longValue)
          Constructor.
SingleTypeFieldManager(java.lang.Object objectValue)
          Constructor.
SingleTypeFieldManager(short shortValue)
          Constructor.
SingleTypeFieldManager(java.lang.String stringValue)
          Constructor.
 
Method Summary
 boolean fetchBooleanField(int fieldNum)
          Accessor for boolean field.
 byte fetchByteField(int fieldNum)
          Accessor for byte field.
 char fetchCharField(int fieldNum)
          Accessor for char field.
 double fetchDoubleField(int fieldNum)
          Accessor for double field.
 float fetchFloatField(int fieldNum)
          Accessor for float field.
 int fetchIntField(int fieldNum)
          Accessor for int field.
 long fetchLongField(int fieldNum)
          Accessor for long field.
 java.lang.Object fetchObjectField(int fieldNum)
          Accessor for object field.
 short fetchShortField(int fieldNum)
          Accessor for short field.
 java.lang.String fetchStringField(int fieldNum)
          Accessor for string field.
 void storeBooleanField(int fieldNum, boolean value)
          Mutator for boolean field.
 void storeByteField(int fieldNum, byte value)
          Mutator for byte field.
 void storeCharField(int fieldNum, char value)
          Mutator for char field.
 void storeDoubleField(int fieldNum, double value)
          Mutator for double field.
 void storeFloatField(int fieldNum, float value)
          Mutator for float field.
 void storeIntField(int fieldNum, int value)
          Mutator for int field.
 void storeLongField(int fieldNum, long value)
          Mutator for long field.
 void storeObjectField(int fieldNum, java.lang.Object value)
          Mutator for Object field.
 void storeShortField(int fieldNum, short value)
          Mutator for short field.
 void storeStringField(int fieldNum, java.lang.String value)
          Mutator for String field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleTypeFieldManager

public SingleTypeFieldManager()
Default Constructor.


SingleTypeFieldManager

public SingleTypeFieldManager(boolean booleanValue)
Constructor.

Parameters:
booleanValue - Boolean

SingleTypeFieldManager

public SingleTypeFieldManager(char charValue)
Constructor.

Parameters:
charValue - char

SingleTypeFieldManager

public SingleTypeFieldManager(byte byteValue)
Constructor.

Parameters:
byteValue - byte

SingleTypeFieldManager

public SingleTypeFieldManager(short shortValue)
Constructor.

Parameters:
shortValue - short

SingleTypeFieldManager

public SingleTypeFieldManager(int intValue)
Constructor.

Parameters:
intValue - int

SingleTypeFieldManager

public SingleTypeFieldManager(long longValue)
Constructor.

Parameters:
longValue - Long

SingleTypeFieldManager

public SingleTypeFieldManager(float floatValue)
Constructor.

Parameters:
floatValue - Float

SingleTypeFieldManager

public SingleTypeFieldManager(double doubleValue)
Constructor.

Parameters:
doubleValue - Double

SingleTypeFieldManager

public SingleTypeFieldManager(java.lang.String stringValue)
Constructor.

Parameters:
stringValue - String

SingleTypeFieldManager

public SingleTypeFieldManager(java.lang.Object objectValue)
Constructor.

Parameters:
objectValue - Object
Method Detail

storeBooleanField

public void storeBooleanField(int fieldNum,
                              boolean value)
Mutator for boolean field.

Specified by:
storeBooleanField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchBooleanField

public boolean fetchBooleanField(int fieldNum)
Accessor for boolean field.

Specified by:
fetchBooleanField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Boolean value

storeCharField

public void storeCharField(int fieldNum,
                           char value)
Mutator for char field.

Specified by:
storeCharField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchCharField

public char fetchCharField(int fieldNum)
Accessor for char field.

Specified by:
fetchCharField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Char value

storeByteField

public void storeByteField(int fieldNum,
                           byte value)
Mutator for byte field.

Specified by:
storeByteField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchByteField

public byte fetchByteField(int fieldNum)
Accessor for byte field.

Specified by:
fetchByteField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Byte value

storeShortField

public void storeShortField(int fieldNum,
                            short value)
Mutator for short field.

Specified by:
storeShortField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchShortField

public short fetchShortField(int fieldNum)
Accessor for short field.

Specified by:
fetchShortField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Short value

storeIntField

public void storeIntField(int fieldNum,
                          int value)
Mutator for int field.

Specified by:
storeIntField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchIntField

public int fetchIntField(int fieldNum)
Accessor for int field.

Specified by:
fetchIntField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Int value

storeLongField

public void storeLongField(int fieldNum,
                           long value)
Mutator for long field.

Specified by:
storeLongField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchLongField

public long fetchLongField(int fieldNum)
Accessor for long field.

Specified by:
fetchLongField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Long value

storeFloatField

public void storeFloatField(int fieldNum,
                            float value)
Mutator for float field.

Specified by:
storeFloatField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchFloatField

public float fetchFloatField(int fieldNum)
Accessor for float field.

Specified by:
fetchFloatField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Float value

storeDoubleField

public void storeDoubleField(int fieldNum,
                             double value)
Mutator for double field.

Specified by:
storeDoubleField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchDoubleField

public double fetchDoubleField(int fieldNum)
Accessor for double field.

Specified by:
fetchDoubleField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Double value

storeStringField

public void storeStringField(int fieldNum,
                             java.lang.String value)
Mutator for String field.

Specified by:
storeStringField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchStringField

public java.lang.String fetchStringField(int fieldNum)
Accessor for string field.

Specified by:
fetchStringField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
String value

storeObjectField

public void storeObjectField(int fieldNum,
                             java.lang.Object value)
Mutator for Object field.

Specified by:
storeObjectField in interface FieldConsumer
Parameters:
fieldNum - Number of field
value - Value

fetchObjectField

public java.lang.Object fetchObjectField(int fieldNum)
Accessor for object field.

Specified by:
fetchObjectField in interface FieldSupplier
Parameters:
fieldNum - Number of field
Returns:
Object value


Copyright © 2009. All Rights Reserved.