AbstractEventData

The AbstractEventData class is an abstract class which allows for the accessing of various data values found within ScreenScraper. Below are the various classes that extend AbstractEventData

AbstractEventData is extended by the following classes and it is those classes that should be used in place of AbstractEventData.

getLastReturnValue

Object getLastReturnValue ( )

Description

Returns the LastReturnValue for the object. This is the value previously returned by another callback. This can be null, if no callbacks have been fired yet for this event. A null value is also the default return value for the given event.

Parameters

This method does not receive any parameters.

Return Values

Returns the LastReturnValue for the object.

Change Log

Version Description
6.0.55a Available for all editions.

Examples

Write to Log

   // In practice AbstractEventData is just the abstract class.
   // You must actually use one of the classes that extend it.
    public Object handleEvent(EventFireTime fireTime, AbstractEventData data) {
        // While you can specifically grab any data from the data object,
                // if this is a method that has a return value that matters,
                // it's best to get it as the last return value, so that multiple
                // events can be chained together.  The input data object
                // will always have the original values for all the other getters
                Object returnValue = data.getLastReturnValue();

       
        // do something
       
        // The EventFireTime values describe in the documentation what the return
                // value will do, or says nothing about it if the value is ignored
                // If you don't intend to modify the return, always return data.getLastReturnValue();
        return data.getLastReturnValue();
    }

setLastReturnValue

void setLastReturnValue ( Object lastReturnValue )

Description

Sets the LastReturnValue fro the object.

Parameters

  • lastReturnValue The new value for the LastReturnValue

Return Values

Returns void.

Change Log

Version Description
6.0.55a Available for all editions.

Examples

   // In practice AbstractEventData is just the abstract class.
   // You must actually use one of the classes that extend it.
    public Object handleEvent(EventFireTime fireTime, AbstractEventData data) {
               
        Object foo = // something here;
        data.setLastReturnValue(foo);
       
        // do something
       
        // The EventFireTime values describe in the documentation what the return
                // value will do, or says nothing about it if the value is ignored
                // If you don't intend to modify the return, always return data.getLastReturnValue();
        return data.getLastReturnValue();
    }