NEXMarkGeneratorSource bids = new NEXMarkGeneratorSource(AUCTION_DATA_DIR,
        CASTOR_MAPPING_FILE, NEXMarkGeneratorSource.BID_STREAM);
bids.setCloseMode(Source.AUTOMATIC_CLOSE);

final long windowSize = 10*60; // 10 min.
TemporalWindow fixedWindow = new TemporalWindow(bids, 0, windowSize);
    
TemporalAggregator aggregator = new TemporalAggregator(fixedWindow,
        new TemporalAggregatorSA(
                new Function() {
                    protected Bid bid;
                    protected LinkedList maxima;
                    protected float maxValue;
                        
                    public Object invoke (Object agg, Object next) {
                        bid = (Bid)next;
                        if (agg == null) {
                            maxima = new LinkedList();
                            maxima.add(bid);
                            return maxima;
                        }
                        maxima = (LinkedList)agg;
                        maxValue = ((Bid)maxima.getFirst()).getBid();
                        if (bid.getBid() > maxValue) {
                            maxima = new LinkedList();
                            maxima.add(bid);
                            return maxima;
                        }
                        if (bid.getBid() == maxValue) {
                            List l = (List)maxima.clone();
                            l.add(bid);
                            return l;
                        }
                        return maxima.clone();
                    }
                }
        )
);
  
	
sink = new SWTSink(aggregator, "SWTSink", true, tf, SWT.MIN);
sink2 = new SWTSink(fixedWindow, "Window", true, tf, SWT.MIN);
    
aggregator.setMetaDataFactory(
	new MetaDataFactory(aggregator, DEFAULT_METADATA2)
);
        
SWTPerformanceMonitor monitor = new SWTPerformanceMonitor((CompositeMetaData)aggregator.getMetaData(), tf, SWT.NONE);				
