本文整理汇总了Java中com.espertech.esper.collection.RefCountedSet类的典型用法代码示例。如果您正苦于以下问题:Java RefCountedSet类的具体用法?Java RefCountedSet怎么用?Java RefCountedSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RefCountedSet类属于com.espertech.esper.collection包,在下文中一共展示了RefCountedSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UnionView
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public UnionView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext, UnionViewFactory factory, EventType eventType, List<View> viewList) {
this.agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
this.unionViewFactory = factory;
this.eventType = eventType;
this.views = viewList.toArray(new View[viewList.size()]);
this.unionWindow = new RefCountedSet<EventBean>();
oldEventsPerView = new EventBean[viewList.size()][];
for (int i = 0; i < viewList.size(); i++) {
LastPostObserverView view = new LastPostObserverView(i);
views[i].removeAllViews();
views[i].addView(view);
view.setObserver(this);
}
// recover
for (int i = 0; i < views.length; i++) {
Iterator<EventBean> viewSnapshot = views[i].iterator();
for (; viewSnapshot.hasNext(); ) {
EventBean theEvent = viewSnapshot.next();
unionWindow.add(theEvent);
}
}
}
示例2: UnionAsymetricView
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public UnionAsymetricView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext, UnionViewFactory factory, EventType eventType, List<View> viewList) {
this.agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
this.unionViewFactory = factory;
this.eventType = eventType;
this.views = viewList.toArray(new View[viewList.size()]);
this.unionWindow = new RefCountedSet<EventBean>();
oldEventsPerView = new EventBean[viewList.size()][];
for (int i = 0; i < viewList.size(); i++) {
LastPostObserverView view = new LastPostObserverView(i);
views[i].removeAllViews();
views[i].addView(view);
view.setObserver(this);
}
// recover
for (int i = 0; i < views.length; i++) {
Iterator<EventBean> viewSnapshot = views[i].iterator();
for (; viewSnapshot.hasNext(); ) {
EventBean theEvent = viewSnapshot.next();
unionWindow.add(theEvent);
}
}
}
示例3: computeAvedev
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
/**
* NOTE: Code-generation-invoked method, method name and parameter order matters
*
* @param valueSet values
* @param sum sum
* @return value
*/
public static Object computeAvedev(RefCountedSet<Double> valueSet, double sum) {
int datapoints = valueSet.size();
if (datapoints == 0) {
return null;
}
double total = 0;
double avg = sum / datapoints;
for (Iterator<Map.Entry<Double, Integer>> it = valueSet.entryIterator(); it.hasNext(); ) {
Map.Entry<Double, Integer> entry = it.next();
total += entry.getValue() * Math.abs(entry.getKey() - avg);
}
return total / datapoints;
}
示例4: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public void rowMemberCodegen(int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized, ExprForge[] forges, CodegenClassScope classScope) {
AggregationFunctionFactoryCodegenRowMemberContext ctx = new AggregationFunctionFactoryCodegenRowMemberContext(parent, column, ctor, membersColumnized);
CodegenMember factory = classScope.makeAddMember(AggregationFunctionFactory.class, aggregationFunctionFactory);
if (aggregationFunctionFactory.getCodegenType() == CODEGEN_NONE) {
membersColumnized.addMember(column, AggregationMethod.class, "method");
ctor.getBlock().assignRef(refCol("method", column), exprDotMethod(member(factory.getMemberId()), "newAggregator"));
return;
}
aggregationFunctionFactory.rowMemberCodegen(ctx);
if (aggregationFunctionFactory.getCodegenType() == CODEGEN_MANAGED && forges.length != 0) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例5: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, RefCountedSet.class, "valueSet");
membersColumnized.addMember(column, double.class, "sum");
ctor.getBlock().assignRef(refCol("valueSet", column), newInstance(RefCountedSet.class));
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例6: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, BigDecimal.class, "sum");
membersColumnized.addMember(column, long.class, "cnt");
ctor.getBlock().assignRef(refCol("sum", column), newInstance(BigDecimal.class, constant(0d)));
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例7: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(AggregationMethodFactoryNth forge, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, Object[].class, "circularBuffer");
membersColumnized.addMember(column, int.class, "currentBufferElementPointer");
membersColumnized.addMember(column, long.class, "numDataPoints");
if (forge.getParent().isDistinct()) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例8: rowMemberSumAndCnt
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberSumAndCnt(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized, Class sumType) {
membersColumnized.addMember(column, sumType, "sum");
membersColumnized.addMember(column, long.class, "cnt");
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例9: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, long.class, "cnt");
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例10: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, SortedRefCountedSet.class, "refSet");
ctor.getBlock().assignRef(refCol("refSet", column), newInstance(SortedRefCountedSet.class));
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例11: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, BigInteger.class, "sum");
membersColumnized.addMember(column, long.class, "cnt");
ctor.getBlock().assignRef(refCol("sum", column), staticMethod(BigInteger.class, "valueOf", constant(0)));
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例12: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, SortedDoubleVector.class, "vector");
ctor.getBlock().assignRef(refCol("vector", column), newInstance(SortedDoubleVector.class));
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例13: rowMemberCodegen
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
public static void rowMemberCodegen(boolean distinct, int column, CodegenCtor ctor, CodegenMembersColumnized membersColumnized) {
membersColumnized.addMember(column, double.class, "mean");
membersColumnized.addMember(column, double.class, "qn");
membersColumnized.addMember(column, long.class, "cnt");
if (distinct) {
membersColumnized.addMember(column, RefCountedSet.class, "distinctSet");
ctor.getBlock().assignRef(refCol("distinctSet", column), newInstance(RefCountedSet.class));
}
}
示例14: UnionView
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
/**
* Ctor.
* @param factory the view factory
* @param eventType the parent event type
* @param viewList the list of data window views
*/
public UnionView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext, UnionViewFactory factory, EventType eventType, List<View> viewList)
{
this.agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
this.unionViewFactory = factory;
this.eventType = eventType;
this.views = viewList.toArray(new View[viewList.size()]);
this.unionWindow = new RefCountedSet<EventBean>();
oldEventsPerView = new EventBean[viewList.size()][];
for (int i = 0; i < viewList.size(); i++)
{
LastPostObserverView view = new LastPostObserverView(i);
views[i].removeAllViews();
views[i].addView(view);
view.setObserver(this);
}
// recover
for (int i = 0; i < views.length; i++)
{
Iterator<EventBean> viewSnapshot = views[i].iterator();
for (;viewSnapshot.hasNext();)
{
EventBean theEvent = viewSnapshot.next();
unionWindow.add(theEvent);
}
}
}
示例15: UnionAsymetricView
import com.espertech.esper.collection.RefCountedSet; //导入依赖的package包/类
/**
* Ctor.
* @param factory the view factory
* @param eventType the parent event type
* @param viewList the list of data window views
*/
public UnionAsymetricView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext, UnionViewFactory factory, EventType eventType, List<View> viewList)
{
this.agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
this.unionViewFactory = factory;
this.eventType = eventType;
this.views = viewList.toArray(new View[viewList.size()]);
this.unionWindow = new RefCountedSet<EventBean>();
oldEventsPerView = new EventBean[viewList.size()][];
for (int i = 0; i < viewList.size(); i++)
{
LastPostObserverView view = new LastPostObserverView(i);
views[i].removeAllViews();
views[i].addView(view);
view.setObserver(this);
}
// recover
for (int i = 0; i < views.length; i++)
{
Iterator<EventBean> viewSnapshot = views[i].iterator();
for (;viewSnapshot.hasNext();)
{
EventBean theEvent = viewSnapshot.next();
unionWindow.add(theEvent);
}
}
}