Module graph

Class PersistenceField

java.lang.Object
de.grogra.reflect.MemberBase
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
  • Method Details

    • get

      public static PersistenceField get(Field field)
    • getField

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

      public abstract ManageableType.Field getSubfield(int index)
    • getLastField

      public abstract ManageableType.Field getLastField()
    • getShallowSubchain

      public abstract PersistenceField getShallowSubchain(int begin)
    • getQuantity

      public abstract Quantity getQuantity()
    • getMinValue

      public abstract Number getMinValue()
    • getMaxValue

      public abstract Number getMaxValue()
    • isWritable

      public boolean isWritable(Object object)
    • set

      public final void set(Object o, int[] indices, Object value, Transaction t)
    • get

      public final Object get(Object object, int[] indices)
    • setBoolean

      public abstract void setBoolean(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:
    • insertBoolean

      public abstract void insertBoolean(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:
    • removeBoolean

      public abstract void removeBoolean(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:
    • getBoolean

      public abstract boolean getBoolean(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:
    • setByte

      public abstract void setByte(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:
    • insertByte

      public abstract void insertByte(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:
    • removeByte

      public abstract void removeByte(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:
    • getByte

      public abstract byte getByte(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:
    • setShort

      public abstract void setShort(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:
    • insertShort

      public abstract void insertShort(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:
    • removeShort

      public abstract void removeShort(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:
    • getShort

      public abstract short getShort(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:
    • setChar

      public abstract void setChar(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:
    • insertChar

      public abstract void insertChar(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:
    • removeChar

      public abstract void removeChar(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:
    • getChar

      public abstract char getChar(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:
    • setInt

      public abstract void setInt(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:
    • insertInt

      public abstract void insertInt(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:
    • removeInt

      public abstract void removeInt(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:
    • getInt

      public abstract int getInt(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:
    • setLong

      public abstract void setLong(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:
    • insertLong

      public abstract void insertLong(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:
    • removeLong

      public abstract void removeLong(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:
    • getLong

      public abstract long getLong(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:
    • setFloat

      public abstract void setFloat(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:
    • insertFloat

      public abstract void insertFloat(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:
    • removeFloat

      public abstract void removeFloat(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:
    • getFloat

      public abstract float getFloat(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:
    • setDouble

      public abstract void setDouble(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:
    • insertDouble

      public abstract void insertDouble(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:
    • removeDouble

      public abstract void removeDouble(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:
    • getDouble

      public abstract double getDouble(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:
    • setObject

      public abstract void setObject(Object o, int[] indices, 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:
    • insertObject

      public abstract void insertObject(Object o, int[] indices, 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:
    • removeObject

      public abstract void removeObject(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:
    • getObject

      public abstract Object getObject(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: