com.tc.object.dna.api
Class PhysicalAction

java.lang.Object
  extended by com.tc.object.dna.api.PhysicalAction

public class PhysicalAction
extends java.lang.Object

A physical object change action


Constructor Summary
PhysicalAction(int index, java.lang.Object value, boolean isReference)
          Construct a physical action representing a single array element change.
PhysicalAction(java.lang.Object value)
          Construct a physical action representing a new value for an entire array
PhysicalAction(java.lang.Object value, int startPos)
          Construct a physical action representing a new subarray
PhysicalAction(java.lang.String field, java.lang.Object value, boolean isReference)
          Construct a physical action that consists of a field, a new value, and whether the new value is a reference.
 
Method Summary
 int getArrayIndex()
          If this is an array element, the index of the element.
 java.lang.String getFieldName()
          Get field name, only valid if this physical action is a true physical field change.
 java.lang.Object getObject()
          Get object value
 boolean isArrayElement()
           
 boolean isEntireArray()
           
 boolean isReference()
          Is the object a reference?
 boolean isSubArray()
           
 boolean isTruePhysical()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicalAction

public PhysicalAction(java.lang.Object value)
Construct a physical action representing a new value for an entire array

Parameters:
value - The new array

PhysicalAction

public PhysicalAction(java.lang.Object value,
                      int startPos)
Construct a physical action representing a new subarray

Parameters:
value - The new subarray
startPos - The starting position for the new subarray

PhysicalAction

public PhysicalAction(int index,
                      java.lang.Object value,
                      boolean isReference)
Construct a physical action representing a single array element change.

Parameters:
index - The index in the array parent
value - The new value for the array element
isReference - Whether the new value is a reference

PhysicalAction

public PhysicalAction(java.lang.String field,
                      java.lang.Object value,
                      boolean isReference)
Construct a physical action that consists of a field, a new value, and whether the new value is a reference.

Method Detail

getFieldName

public java.lang.String getFieldName()
Get field name, only valid if this physical action is a true physical field change.

Returns:
Field name, never null
Throws:
java.lang.IllegalStateException - If called on an action that returns false for isTruePhysical()

getObject

public java.lang.Object getObject()
Get object value

Returns:
Object value

isReference

public boolean isReference()
Is the object a reference?

Returns:
True if reference

getArrayIndex

public int getArrayIndex()
If this is an array element, the index of the element. If this is a subarray, the starting position of the new subarray. Otherwise, an error.

Returns:
The array index
Throws:
java.lang.IllegalStateException - If not an array element or subarray

isTruePhysical

public boolean isTruePhysical()
Returns:
True if this is a true physical field change

isArrayElement

public boolean isArrayElement()
Returns:
True if this is an array element change

isEntireArray

public boolean isEntireArray()
Returns:
True if this is an entire array change

isSubArray

public boolean isSubArray()
Returns:
True if this is a subarray change


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.