當前位置: 首頁>>代碼示例>>Java>>正文


Java RefCountedSet類代碼示例

本文整理匯總了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);
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:25,代碼來源:UnionView.java

示例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);
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:25,代碼來源:UnionAsymetricView.java

示例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;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:25,代碼來源:AggregatorAvedev.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:16,代碼來源:AggregationMethodFactoryPlugIn.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:11,代碼來源:AggregatorAvedev.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:AggregatorAvgBigDecimal.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:AggregatorNth.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:9,代碼來源:AggregatorCodegenUtil.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:8,代碼來源:AggregatorCount.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:9,代碼來源:AggregatorMinMax.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:AggregatorSumBigInteger.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:9,代碼來源:AggregatorMedian.java

示例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));
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:AggregatorStddev.java

示例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);
        }
    }
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:35,代碼來源:UnionView.java

示例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);
        }
    }
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:35,代碼來源:UnionAsymetricView.java


注:本文中的com.espertech.esper.collection.RefCountedSet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。