Hi,
I'm new to JAVA and busy working with an API and I've hit a brick wall. What I want to do is extract information from an extended API class into the main body of the program. So, the extended class looks like this:
class Ticker extends FXRateEvent { // No key set and no match implemented; this event matches all RateEventInfos public void handle(FXEventInfo EI, FXEventManager EM) { //Just print the tick FXRateEventInfo REI = (FXRateEventInfo) EI; System.out.println(REI.getTick()+ ":"+ REI.getTimestamp()); // FXPair changedPair = REI.getPair(); // System.out.println(changedPair); } }
Now I can call the class like so and it prints all the information:
Ticker ticker = new Ticker(); try { fxgame.getRateTable().getEventManager().add(ticker); } catch (SessionException e) { fxgame.logout(); System.exit(1); }
The problem is it's the class that doing the printing. In particular I am after the information in the line: FXPair changedPair = REI.getPair();
I want to use that information in the Main body of the code. Can anyone tell me how to get that out of the class? I know I'm supposed to do a method and then call it, but all my attempts so far have failed.