ptolemy.backtrack.util
Class FieldRecordState

java.lang.Object
  extended by ptolemy.backtrack.util.FieldRecordState

public class FieldRecordState
extends java.lang.Object

The state of a field record. A field record records the changes in a field. Each Rollbackable object may have 0 or more field records. The information of a field record is kept in a field record state. When a new checkpoint object is assigned to the Rollbackable object, its previous field record states are pushed on to stacks, and new states are allocated. When the previous checkpoint object is restored to the Rollbackable object, the previous field record states are popped out.

Since:
Ptolemy II 5.1
Version:
$Id: FieldRecordState.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Thomas Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Field Summary
private  int _identifier
          An increasing identifier for each record.
private  FieldRecord.RecordList[] _records
          The record lists for all the dimensions.
private  int _totalNum
          The total number of records in all the dimensions.
 
Constructor Summary
protected FieldRecordState(int dimensions)
          Construct a field record.
 
Method Summary
protected  int _decreaseTotalNum()
          Decrease the total number of changes recorded in this field record state by 1.
protected  int _getIdentifier()
          Get the identifier of this field record state.
protected  FieldRecord.RecordList[] _getRecords()
          Get the array of change history for different numbers of indices.
protected  int _getTotalNum()
          Get the total number of changes recorded in this field record state.
protected  int _increaseIdentifier()
          Increase the identifier of this field record state by 1.
protected  int _increaseTotalNum()
          Increase the total number of changes recorded in this field record state by 1.
protected  void _setTotalNum(int totalNum)
          Set the total number of changes recorded in this field record state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_identifier

private int _identifier
An increasing identifier for each record.


_records

private FieldRecord.RecordList[] _records
The record lists for all the dimensions.


_totalNum

private int _totalNum
The total number of records in all the dimensions. Must be explicitly managed when records are added or removed.

Constructor Detail

FieldRecordState

protected FieldRecordState(int dimensions)
Construct a field record.

Parameters:
dimensions - The number of dimensions of this field.
Method Detail

_decreaseTotalNum

protected int _decreaseTotalNum()
Decrease the total number of changes recorded in this field record state by 1.

Returns:
The new total number of changes recorded.
See Also:
_getTotalNum(), _increaseTotalNum(), _setTotalNum(int)

_getIdentifier

protected int _getIdentifier()
Get the identifier of this field record state.

Returns:
The identifier.

_getRecords

protected FieldRecord.RecordList[] _getRecords()
Get the array of change history for different numbers of indices.

Returns:
The array of change history.

_getTotalNum

protected int _getTotalNum()
Get the total number of changes recorded in this field record state.

Returns:
The total number of changes.
See Also:
_setTotalNum(int)

_increaseIdentifier

protected int _increaseIdentifier()
Increase the identifier of this field record state by 1.

Returns:
The new identifier.
See Also:
_getIdentifier()

_increaseTotalNum

protected int _increaseTotalNum()
Increase the total number of changes recorded in this field record state by 1.

Returns:
The new total number of changes recorded.
See Also:
_decreaseTotalNum(), _getTotalNum(), _setTotalNum(int)

_setTotalNum

protected void _setTotalNum(int totalNum)
Set the total number of changes recorded in this field record state.

Parameters:
totalNum - The new total number of changes.
See Also:
_getTotalNum()