gishur.core.algorithms
Class TraceObject

java.lang.Object
  |
  +--gishur.core.algorithms.TraceObject

public class TraceObject
extends java.lang.Object

An instance of the TraceObject class can record various states of an object. It provides fast access to that states via time and step.

Version:
1.0
Author:
Thomas Wolf

Method Summary
 boolean accessMode()
          Returns true, if the TraceObject is in access mode, that means it can fast access special recorded object instances.
 java.lang.Object instance(int step_nr)
          Returns the stored instance according to the given step number.
 java.lang.Object[] instances(int step_start, int step_end)
          Returns an array of recorded instances between the steps step_start and step_end.
 java.lang.String name()
          Returns the name of the object.
 void record(java.lang.Object instance)
          Records an instance of the object.
 boolean recordMode()
          Returns true, if the TraceObject is in record mode, that means it can record new instances, but cannot access any other instances.
 void recordNoClone(java.lang.Object instance)
          Records an instance of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

name

public java.lang.String name()
Returns the name of the object.
Returns:
the name of the object.

recordMode

public boolean recordMode()
Returns true, if the TraceObject is in record mode, that means it can record new instances, but cannot access any other instances.
Returns:
true, if the TraceObject is in record mode.

accessMode

public boolean accessMode()
Returns true, if the TraceObject is in access mode, that means it can fast access special recorded object instances.
Returns:
true, if the TraceObject is in access mode.

instance

public java.lang.Object instance(int step_nr)
Returns the stored instance according to the given step number. The returned instance will be the latest recording on or before the given step number. The method will return the latest recording step, iff the recording mode for the TraceObject is not finished.

instances

public java.lang.Object[] instances(int step_start,
                                    int step_end)
Returns an array of recorded instances between the steps step_start and step_end. That means all instances, that are recorded after step_start until step_end are returned.
Parameters:
step_start - the step number after that instances should be returned
step_end - the step number until that instanced should be returned
Returns:
array of instances between step_start and step_end.

record

public void record(java.lang.Object instance)
Records an instance of the object. The data will be cloned. The TraceObject e.g. the Tracer must be in record mode - otherwise an TraceException will be thrown.
Parameters:
instance - the object instance to record

recordNoClone

public void recordNoClone(java.lang.Object instance)
Records an instance of the object. The data will not be cloned (this should only be done, if its secure, that the object will never be changed). The TraceObject e.g. the Tracer must be in record mode - otherwise an TraceException will be thrown.
Parameters:
instance - the object instance to record