patterntesting.runtime.log
Class ObjectPlayer

Package class diagram package ObjectPlayer
java.lang.Object
  extended by patterntesting.runtime.log.ObjectPlayer

public final class ObjectPlayer
extends Object

This is the counterpart to ObjectRecorder class. It can be used to replay recorded objects.

Since:
1.3.1 (31.08.2013)
Author:
oliver (boehm@javatux.de)

Constructor Summary
ObjectPlayer(File logFile)
          Instantiates a new object player.
 
Method Summary
 boolean equals(Object obj)
          Equals.
 Object getReturnValue(JoinPoint joinPoint)
          Gets the return value for the given joinpoint.
 int hashCode()
          Hash code.
 void load(File logFile)
          If you want to use an always recored object log you can load it with this method.
 void load(InputStream istream)
          If you want to use an always recored object log you can load it with this method.
 String toString()
          To string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectPlayer

public ObjectPlayer(File logFile)
             throws IOException
Instantiates a new object player. The logged objects will be loaded from the given log file.

Parameters:
logFile - the log file
Throws:
IOException - Signals that an I/O exception has occurred.
Method Detail

getReturnValue

public Object getReturnValue(JoinPoint joinPoint)
Gets the return value for the given joinpoint. The return values are returned in the same order as the were recorded. I.e. if for the same joinpoint first the value "1" and then the value "2" is recorded you'll get first "1", then "2" as the return value.

Parameters:
joinPoint - the join point
Returns:
the return value

load

public void load(File logFile)
          throws IOException
If you want to use an always recored object log you can load it with this method. This allows you to use different files for logging and loading of recorded objects.

Parameters:
logFile - the log file
Throws:
IOException - Signals that an I/O exception has occurred.

load

public void load(InputStream istream)
          throws IOException
If you want to use an always recored object log you can load it with this method. This allows you to use different files for logging and loading of recorded objects.

Parameters:
istream - the istream
Throws:
IOException - Signals that an I/O exception has occurred.

hashCode

public int hashCode()
Hash code.

Overrides:
hashCode in class Object
Returns:
the int
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Equals.

Overrides:
equals in class Object
Parameters:
obj - the obj
Returns:
true, if successful
See Also:
Object.equals(java.lang.Object)

toString

public String toString()
To string.

Overrides:
toString in class Object
Returns:
the string
See Also:
Object.toString()


Copyright © 2002–2014 PatternTesting Team. All rights reserved.