ptolemy.backtrack.util
Class FieldRecord.Record

java.lang.Object
  extended by ptolemy.backtrack.util.FieldRecord.Record
Enclosing class:
FieldRecord

public class FieldRecord.Record
extends java.lang.Object

Record of an old value.

Since:
Ptolemy II 5.1
Version:
$Id: FieldRecord.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
          The identifier of this record (unique for each field).
private  int[] _indices
          The indices.
private  boolean _isBackup
          Whether this record is a backup of an array.
private  long _timestamp
          The timestamp.
private  java.lang.Object _value
          The old value.
 
Constructor Summary
FieldRecord.Record(int[] indices, java.lang.Object value, long timestamp)
          Construct a record and store an old value in it.
FieldRecord.Record(int[] indices, java.lang.Object value, long timestamp, boolean isBackup)
          Construct a record and store an old value in it.
 
Method Summary
 int getIdentifier()
          Get the identifier of this record.
 int[] getIndices()
          Get the indices on the left-hand side of the assignment.
 long getTimestamp()
          Get the timestamp taken at the time when the record is created.
 java.lang.Object getValue()
          Get the old value of this record.
 boolean isBackup()
          Test if this record is a backup of an array.
 java.lang.String toString()
          Convert this record to a readable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_identifier

private int _identifier
The identifier of this record (unique for each field).


_indices

private int[] _indices
The indices.


_isBackup

private boolean _isBackup
Whether this record is a backup of an array.


_timestamp

private long _timestamp
The timestamp.


_value

private java.lang.Object _value
The old value.

Constructor Detail

FieldRecord.Record

FieldRecord.Record(int[] indices,
                   java.lang.Object value,
                   long timestamp)
Construct a record and store an old value in it. The record is not a backup of an array.

Parameters:
indices - The indices on the left-hand side of the assignment.
value - The old value. If the old value is of a primitive type, it should be boxed with the corresponding object type.
timestamp - The current timestamp.

FieldRecord.Record

FieldRecord.Record(int[] indices,
                   java.lang.Object value,
                   long timestamp,
                   boolean isBackup)
Construct a record and store an old value in it.

Parameters:
indices - The indices on the left-hand side of the assignment.
value - The old value. If the old value is of a primitive type, it should be boxed with the corresponding object type.
timestamp - The current timestamp.
isBackup - Whether this record is a backup of an array.
Method Detail

getIdentifier

public int getIdentifier()
Get the identifier of this record. Each record for a field has a unique identifier. Identifiers increase over time. Records for different fields may have the same identifier.

Returns:
The identifier.

getIndices

public int[] getIndices()
Get the indices on the left-hand side of the assignment.

Returns:
The indices, or null if no index is used.

getTimestamp

public long getTimestamp()
Get the timestamp taken at the time when the record is created.

Returns:
The timestamp.

getValue

public java.lang.Object getValue()
Get the old value of this record. If the old value is of a primitive type, it is boxed with the corresponding object type.

Returns:
The old value.

isBackup

public boolean isBackup()
Test if this record is a backup of an array.

Returns:
trueif this record is a backup of an array.

toString

public java.lang.String toString()
Convert this record to a readable string.

Overrides:
toString in class java.lang.Object
Returns:
The string.