
// this needs to be modified to work with the new java 7 date class

package tap.sample;

import tap.*;
import quantbench.Candle;

public class Subscribe {
    public static main(String[] args) throws Exception {
        Tap tap = new Tap();
        tap.startTime("2011-01-03 10:40:00.000");
        tap.endTime("2011-01-03 10:50:00.000");
        Pipe<Candle> candles = tap.subscribe("//cta/candle/1min[AAPL]");
        while (candles.more()) {
            Candle m = candles.get();
            Date time = Tap.newDate(m.getStartTime());
            System.out.println(time.toString + " symbol " + m.getSymbol() + 
                               " open " + m.getOpen() + " volume " + m.getVolume());
        }
    }
}
// this needs to be modified to work with the new java 7 date class

package tap.sample;

import tap.*;
import quantbench.Candle;

public class Subscribe {
    
    // Usage: hadoop jar yourjar.jar -s 2011-01-03 10:40:00.000 -e 2011-01-03 10:50:00.000
    public static main(String[] args) throws Exception {
        CommandOptions o = new CommandOptions(args);
        Tap tap = new Tap(o);
        
        Pipe<Candle> candles = tap.subscribe("//cta/candle/1min[AAPL]");
        while (candles.more()) {
            Candle m = candles.get();
            Date time = Tap.newDate(m.getStartTime());
            System.out.println(time.toString + " symbol " + m.getSymbol() + 
                               " open " + m.getOpen() + " volume " + m.getVolume());
        }
    }
}
Fix Tap constructor, pass start and end time via command line arguments.
Fix Tap constructor, pass start and end time via command line arguments.