com.northconcepts.datapipeline.group
Class AggregateReader

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataReader
          extended by com.northconcepts.datapipeline.core.ProxyReader
              extended by com.northconcepts.datapipeline.group.AggregateReader

public class AggregateReader
extends ProxyReader

A proxy that applies set functions (sum, max, etc.) to fields of records passing through.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State
 
Field Summary
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
AggregateReader(DataReader targetDataSource)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 AggregateReader average(String fieldName)
           
 AggregateReader clear()
           
 AggregateReader count(String fieldName)
           
 Object getAverage(String fieldName)
           
 Object getCount(String fieldName)
           
 Object getMaximum(String fieldName)
           
 Object getMinimum(String fieldName)
           
 Object getSum(String fieldName)
           
protected  Record interceptRecord(Record record)
           
 AggregateReader maximum(String fieldName)
           
 AggregateReader minimum(String fieldName)
           
 void open()
          Makes this endpoint ready for reading or writing.
 void reset()
           
 AggregateReader sum(String fieldName)
           
 String toString()
           
 
Methods inherited from class com.northconcepts.datapipeline.core.ProxyReader
available, close, getNestedReader, readImpl, setNestedDataReader, setNestedDataReader
 
Methods inherited from class com.northconcepts.datapipeline.core.DataReader
getBufferSize, getRootReader, peek, pop, push, read, skip
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateReader

public AggregateReader(DataReader targetDataSource)
Method Detail

addExceptionProperties

public DataException addExceptionProperties(DataException exception)
Description copied from class: DataEndpoint
Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.

Overrides:
addExceptionProperties in class ProxyReader

interceptRecord

protected Record interceptRecord(Record record)
                          throws Throwable
Overrides:
interceptRecord in class ProxyReader
Throws:
Throwable

clear

public AggregateReader clear()

reset

public void reset()

open

public void open()
          throws DataException
Description copied from class: DataEndpoint
Makes this endpoint ready for reading or writing.

Overrides:
open in class ProxyReader
Throws:
DataException

minimum

public AggregateReader minimum(String fieldName)

maximum

public AggregateReader maximum(String fieldName)

sum

public AggregateReader sum(String fieldName)

average

public AggregateReader average(String fieldName)

count

public AggregateReader count(String fieldName)

getMinimum

public Object getMinimum(String fieldName)

getMaximum

public Object getMaximum(String fieldName)

getSum

public Object getSum(String fieldName)

getAverage

public Object getAverage(String fieldName)

getCount

public Object getCount(String fieldName)

toString

public String toString()
Overrides:
toString in class DataEndpoint


Copyright (c) 2007-2009 North Concepts Inc. All Rights Reserved.