Class ObjectPlayer


  • public final class ObjectPlayer
    extends java.lang.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

      Constructors 
      Constructor Description
      ObjectPlayer​(java.io.File logFile)
      Instantiates a new object player.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Equals.
      java.lang.Object getReturnValue​(org.aspectj.lang.JoinPoint joinPoint)
      Gets the return value for the given joinpoint.
      int hashCode()
      Hash code.
      void load​(java.io.File logFile)
      If you want to use an always recored object log you can load it with this method.
      void load​(java.io.InputStream istream)
      If you want to use an always recorded object log you can load it with this method.
      java.lang.String toString()
      To string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ObjectPlayer

        public ObjectPlayer​(java.io.File logFile)
                     throws java.io.IOException
        Instantiates a new object player. The logged objects will be loaded from the given log file.
        Parameters:
        logFile - the log file
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
    • Method Detail

      • getReturnValue

        public java.lang.Object getReturnValue​(org.aspectj.lang.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​(java.io.File logFile)
                  throws java.io.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:
        java.io.IOException - Signals that an I/O exception has occurred.
      • load

        public void load​(java.io.InputStream istream)
                  throws java.io.IOException
        If you want to use an always recorded 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:
        java.io.IOException - Signals that an I/O exception has occurred.
      • hashCode

        public int hashCode()
        Hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the int
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Equals.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the obj
        Returns:
        true, if successful
        See Also:
        Object.equals(java.lang.Object)
      • toString

        public java.lang.String toString()
        To string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string
        See Also:
        Object.toString()