com.espertech.esper.view.stat
Class CorrelationView

java.lang.Object
  extended by com.espertech.esper.view.ViewSupport
      extended by com.espertech.esper.view.stat.BaseBivariateStatisticsView
          extended by com.espertech.esper.view.stat.CorrelationView
All Implemented Interfaces:
CloneableView, DerivedValueView, EventCollection, GroupableView, View, Viewable, java.lang.Iterable<EventBean>

public class CorrelationView
extends BaseBivariateStatisticsView
implements CloneableView

A view that calculates correlation on two fields. The view uses internally a BaseStatisticsBean instance for the calculations, it also returns this bean as the result. This class accepts most of its behaviour from its parent, BaseBivariateStatisticsView. It adds the usage of the correlation bean and the appropriate schema.


Field Summary
 
Fields inherited from class com.espertech.esper.view.stat.BaseBivariateStatisticsView
additionalProps, agentInstanceContext, eventType, lastValuesEventNew, statisticsBean, viewFactory
 
Fields inherited from class com.espertech.esper.view.ViewSupport
EMPTY_VIEW_ARRAY, parent
 
Constructor Summary
CorrelationView(ViewFactory viewFactory, AgentInstanceContext agentInstanceContext, ExprNode xExpression, ExprNode yExpression, EventType eventType, StatViewAdditionalProps additionalProps)
          Constructor.
 
Method Summary
 View cloneView()
          Duplicates the view.
protected static EventType createEventType(StatementContext statementContext, StatViewAdditionalProps additionalProps, int streamNum)
          Creates the event type for this view.
static EventBean doPopulateMap(BaseStatisticsBean baseStatisticsBean, EventAdapterService eventAdapterService, EventType eventType, StatViewAdditionalProps additionalProps, java.lang.Object[] decoration)
          Populate bean.
 EventType getEventType()
          Provides metadata information about the type of object the event collection contains.
 EventBean populateMap(BaseStatisticsBean baseStatisticsBean, EventAdapterService eventAdapterService, EventType eventType, StatViewAdditionalProps additionalProps, java.lang.Object[] decoration)
          Populate bean.
 java.lang.String toString()
           
 
Methods inherited from class com.espertech.esper.view.stat.BaseBivariateStatisticsView
getAdditionalProps, getExpressionX, getExpressionY, getLastValuesEventNew, getStatisticsBean, getViewFactory, iterator, setLastValuesEventNew, update
 
Methods inherited from class com.espertech.esper.view.ViewSupport
addView, addView, dumpChildViews, dumpUpdateParams, dumpUpdateParams, findDescendent, findViewIndex, getParent, getViews, hasViews, removeAllViews, removeView, removeView, setParent, updateChildren, updateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.espertech.esper.view.View
getParent, setParent
 
Methods inherited from interface com.espertech.esper.view.Viewable
addView, getViews, hasViews, removeAllViews, removeView
 

Constructor Detail

CorrelationView

public CorrelationView(ViewFactory viewFactory,
                       AgentInstanceContext agentInstanceContext,
                       ExprNode xExpression,
                       ExprNode yExpression,
                       EventType eventType,
                       StatViewAdditionalProps additionalProps)
Constructor.

Parameters:
xExpression - is the expression providing X data points
yExpression - is the expression providing X data points
agentInstanceContext - contains required view services
eventType - event type
additionalProps - additional properties
Method Detail

cloneView

public View cloneView()
Description copied from interface: CloneableView
Duplicates the view.

Expected to return a same view in initialized state for grouping.

Specified by:
cloneView in interface CloneableView

populateMap

public EventBean populateMap(BaseStatisticsBean baseStatisticsBean,
                             EventAdapterService eventAdapterService,
                             EventType eventType,
                             StatViewAdditionalProps additionalProps,
                             java.lang.Object[] decoration)
Description copied from class: BaseBivariateStatisticsView
Populate bean.

Specified by:
populateMap in class BaseBivariateStatisticsView
Parameters:
baseStatisticsBean - results
eventAdapterService - event adapters
eventType - type
additionalProps - additional props
decoration - decoration values
Returns:
bean

doPopulateMap

public static EventBean doPopulateMap(BaseStatisticsBean baseStatisticsBean,
                                      EventAdapterService eventAdapterService,
                                      EventType eventType,
                                      StatViewAdditionalProps additionalProps,
                                      java.lang.Object[] decoration)
Populate bean.

Parameters:
baseStatisticsBean - results
eventAdapterService - event wrapping
eventType - type to produce
additionalProps - addition properties
decoration - decoration values
Returns:
bean

getEventType

public EventType getEventType()
Description copied from interface: EventCollection
Provides metadata information about the type of object the event collection contains.

Specified by:
getEventType in interface EventCollection
Returns:
metadata for the objects in the collection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createEventType

protected static EventType createEventType(StatementContext statementContext,
                                           StatViewAdditionalProps additionalProps,
                                           int streamNum)
Creates the event type for this view.

Parameters:
statementContext - is the event adapter service
additionalProps - additional props
Returns:
event type of view

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com