de.grogra.persistence
Class PersistenceField

java.lang.Object
  extended by de.grogra.reflect.MemberBase
      extended by de.grogra.persistence.PersistenceField
All Implemented Interfaces:
Field, FieldChain, Member
Direct Known Subclasses:
IndirectField, ManageableType.Field

public abstract class PersistenceField
extends MemberBase
implements Field, FieldChain

A PersistenceField represents a field which can be handled by classes of the persistence package. It is an abstract base class; its methods imply that a PersistenceField is composed of a chain of fields of class ManageableType.Field. E.g., if an object has a field location of type javax.vecmath.Point3f, such a chain could be (location, x) (then it denotes the x field of the location field of the object). A chain may involve array components. An array component is either an array component in the sense of the Java programming language, e.g., object.values[i], or an element of java.util.List or one of the primitive list classes in de.grogra.util, e.g., object.values.get (i). When a PersistenceField containing array components is accessed by one of its methods, the indices parameter has to provide one index for every component. E.g., a field access object.values[i].locations[j].x is represented by the chain (values, [], locations, [], x), where [] represents array components, and indices = {i, j}.

Author:
Ole Kniemeyer

Field Summary
 
Fields inherited from class de.grogra.reflect.MemberBase
annots, declaringType, descriptor, modifiers, name
 
Fields inherited from interface de.grogra.reflect.Field
FIELD_0, INTERFACE_MODIFIERS, MODIFIERS
 
Fields inherited from interface de.grogra.reflect.Member
ABSTRACT, ACCESS_MODIFIERS, ARRAY, BRIDGE, CONSTANT, FINAL, INTERFACE, JAVA_MODIFIERS, LOCAL_CLASS, MIN_UNUSED_MODIFIER, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE
 
Method Summary
static PersistenceField get(Field field)
           
 java.lang.Object get(java.lang.Object object, int[] indices)
           
abstract  boolean getBoolean(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  byte getByte(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  char getChar(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  double getDouble(java.lang.Object o, int[] indices)
          Returns the value of a field.
 Field getField(int index)
           
abstract  float getFloat(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  int getInt(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  ManageableType.Field getLastField()
           
abstract  long getLong(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  java.lang.Number getMaxValue()
           
abstract  java.lang.Number getMinValue()
           
abstract  java.lang.Object getObject(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  Quantity getQuantity()
           
abstract  PersistenceField getShallowSubchain(int begin)
           
abstract  short getShort(java.lang.Object o, int[] indices)
          Returns the value of a field.
abstract  ManageableType.Field getSubfield(int index)
           
abstract  void insertBoolean(java.lang.Object o, int[] indices, boolean value, Transaction t)
          Inserts the given value into an array.
abstract  void insertByte(java.lang.Object o, int[] indices, byte value, Transaction t)
          Inserts the given value into an array.
abstract  void insertChar(java.lang.Object o, int[] indices, char value, Transaction t)
          Inserts the given value into an array.
abstract  void insertDouble(java.lang.Object o, int[] indices, double value, Transaction t)
          Inserts the given value into an array.
abstract  void insertFloat(java.lang.Object o, int[] indices, float value, Transaction t)
          Inserts the given value into an array.
abstract  void insertInt(java.lang.Object o, int[] indices, int value, Transaction t)
          Inserts the given value into an array.
abstract  void insertLong(java.lang.Object o, int[] indices, long value, Transaction t)
          Inserts the given value into an array.
abstract  void insertObject(java.lang.Object o, int[] indices, java.lang.Object value, Transaction t)
          Inserts the given value into an array.
abstract  void insertShort(java.lang.Object o, int[] indices, short value, Transaction t)
          Inserts the given value into an array.
 boolean isWritable(java.lang.Object object)
           
abstract  void removeBoolean(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeByte(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeChar(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeDouble(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeFloat(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeInt(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeLong(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeObject(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
abstract  void removeShort(java.lang.Object o, int[] indices, Transaction t)
          Removes an element from an array.
 void set(java.lang.Object o, int[] indices, java.lang.Object value, Transaction t)
           
abstract  void setBoolean(java.lang.Object o, int[] indices, boolean value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setByte(java.lang.Object o, int[] indices, byte value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setChar(java.lang.Object o, int[] indices, char value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setDouble(java.lang.Object o, int[] indices, double value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setFloat(java.lang.Object o, int[] indices, float value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setInt(java.lang.Object o, int[] indices, int value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setLong(java.lang.Object o, int[] indices, long value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setObject(java.lang.Object o, int[] indices, java.lang.Object value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
abstract  void setShort(java.lang.Object o, int[] indices, short value, Transaction t)
          Sets the value of this field on the instance o using the given indices and t.
 
Methods inherited from class de.grogra.reflect.MemberBase
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName, getSimpleName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.reflect.Field
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getObject, getShort, getType, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort
 
Methods inherited from interface de.grogra.reflect.Member
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName, getSimpleName
 
Methods inherited from interface de.grogra.reflect.FieldChain
length, overlaps
 

Method Detail

get

public static PersistenceField get(Field field)

get

public final java.lang.Object get(java.lang.Object object,
                                  int[] indices)

getBoolean

public abstract boolean getBoolean(java.lang.Object o,
                                   int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getByte

public abstract byte getByte(java.lang.Object o,
                             int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getChar

public abstract char getChar(java.lang.Object o,
                             int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getDouble

public abstract double getDouble(java.lang.Object o,
                                 int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getField

public final Field getField(int index)
Specified by:
getField in interface FieldChain

getFloat

public abstract float getFloat(java.lang.Object o,
                               int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getInt

public abstract int getInt(java.lang.Object o,
                           int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getLastField

public abstract ManageableType.Field getLastField()

getLong

public abstract long getLong(java.lang.Object o,
                             int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getMaxValue

public abstract java.lang.Number getMaxValue()

getMinValue

public abstract java.lang.Number getMinValue()

getObject

public abstract java.lang.Object getObject(java.lang.Object o,
                                           int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getQuantity

public abstract Quantity getQuantity()

getShallowSubchain

public abstract PersistenceField getShallowSubchain(int begin)

getShort

public abstract short getShort(java.lang.Object o,
                               int[] indices)
Returns the value of a field.

Parameters:
o - the instance for which the field value is returned
indices - the indices for array fields
Returns:
the field's value for the instance pc
See Also:
PersistenceField

getSubfield

public abstract ManageableType.Field getSubfield(int index)

insertBoolean

public abstract void insertBoolean(java.lang.Object o,
                                   int[] indices,
                                   boolean value,
                                   Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertByte

public abstract void insertByte(java.lang.Object o,
                                int[] indices,
                                byte value,
                                Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertChar

public abstract void insertChar(java.lang.Object o,
                                int[] indices,
                                char value,
                                Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertDouble

public abstract void insertDouble(java.lang.Object o,
                                  int[] indices,
                                  double value,
                                  Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertFloat

public abstract void insertFloat(java.lang.Object o,
                                 int[] indices,
                                 float value,
                                 Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertInt

public abstract void insertInt(java.lang.Object o,
                               int[] indices,
                               int value,
                               Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertLong

public abstract void insertLong(java.lang.Object o,
                                int[] indices,
                                long value,
                                Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertObject

public abstract void insertObject(java.lang.Object o,
                                  int[] indices,
                                  java.lang.Object value,
                                  Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

insertShort

public abstract void insertShort(java.lang.Object o,
                                 int[] indices,
                                 short value,
                                 Transaction t)
Inserts the given value into an array. This field has to be an array component indexed by indices. The new value will be inserted at the place of the indexed component.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the value to be inserted
t - transaction context
See Also:
PersistenceField

isWritable

public boolean isWritable(java.lang.Object object)

removeBoolean

public abstract void removeBoolean(java.lang.Object o,
                                   int[] indices,
                                   Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeByte

public abstract void removeByte(java.lang.Object o,
                                int[] indices,
                                Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeChar

public abstract void removeChar(java.lang.Object o,
                                int[] indices,
                                Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeDouble

public abstract void removeDouble(java.lang.Object o,
                                  int[] indices,
                                  Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeFloat

public abstract void removeFloat(java.lang.Object o,
                                 int[] indices,
                                 Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeInt

public abstract void removeInt(java.lang.Object o,
                               int[] indices,
                               Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeLong

public abstract void removeLong(java.lang.Object o,
                                int[] indices,
                                Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeObject

public abstract void removeObject(java.lang.Object o,
                                  int[] indices,
                                  Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

removeShort

public abstract void removeShort(java.lang.Object o,
                                 int[] indices,
                                 Transaction t)
Removes an element from an array. This field has to be an array component indexed by indices. The value at the indexed component will be removed.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
t - transaction context
See Also:
PersistenceField

set

public final void set(java.lang.Object o,
                      int[] indices,
                      java.lang.Object value,
                      Transaction t)

setBoolean

public abstract void setBoolean(java.lang.Object o,
                                int[] indices,
                                boolean value,
                                Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setByte

public abstract void setByte(java.lang.Object o,
                             int[] indices,
                             byte value,
                             Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setChar

public abstract void setChar(java.lang.Object o,
                             int[] indices,
                             char value,
                             Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setDouble

public abstract void setDouble(java.lang.Object o,
                               int[] indices,
                               double value,
                               Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setFloat

public abstract void setFloat(java.lang.Object o,
                              int[] indices,
                              float value,
                              Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setInt

public abstract void setInt(java.lang.Object o,
                            int[] indices,
                            int value,
                            Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setLong

public abstract void setLong(java.lang.Object o,
                             int[] indices,
                             long value,
                             Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setObject

public abstract void setObject(java.lang.Object o,
                               int[] indices,
                               java.lang.Object value,
                               Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField

setShort

public abstract void setShort(java.lang.Object o,
                              int[] indices,
                              short value,
                              Transaction t)
Sets the value of this field on the instance o using the given indices and t.

Parameters:
o - the instance for which the field is modified
indices - the indices for array fields
value - the new value
t - transaction context
See Also:
PersistenceField