本文整理汇总了Java中com.espertech.esper.type.MinMaxTypeEnum类的典型用法代码示例。如果您正苦于以下问题:Java MinMaxTypeEnum类的具体用法?Java MinMaxTypeEnum怎么用?Java MinMaxTypeEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MinMaxTypeEnum类属于com.espertech.esper.type包,在下文中一共展示了MinMaxTypeEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enter
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void enter(Object object)
{
if (object == null)
{
return;
}
if (currentMinMax == null) {
currentMinMax = (Comparable) object;
return;
}
if (minMaxTypeEnum == MinMaxTypeEnum.MAX) {
if (currentMinMax.compareTo(object) < 0) {
currentMinMax = (Comparable) object;
}
}
else {
if (currentMinMax.compareTo(object) > 0) {
currentMinMax = (Comparable) object;
}
}
}
示例2: testAggregatorMax
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testAggregatorMax()
{
AggregatorMinMax agg = new AggregatorMinMax(MinMaxTypeEnum.MAX, int.class);
assertEquals(null, agg.getValue());
agg.enter(10);
assertEquals(10, agg.getValue());
agg.enter(20);
assertEquals(20, agg.getValue());
agg.enter(10);
assertEquals(20, agg.getValue());
agg.leave(10);
assertEquals(20, agg.getValue());
agg.leave(20);
assertEquals(10, agg.getValue());
agg.leave(10);
assertEquals(null, agg.getValue());
}
示例3: testAggregatorMin
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testAggregatorMin()
{
AggregatorMinMax agg = new AggregatorMinMax(MinMaxTypeEnum.MIN, int.class);
assertEquals(null, agg.getValue());
agg.enter(10);
assertEquals(10, agg.getValue());
agg.enter(20);
assertEquals(10, agg.getValue());
agg.enter(10);
assertEquals(10, agg.getValue());
agg.leave(10);
assertEquals(10, agg.getValue());
agg.leave(20);
assertEquals(10, agg.getValue());
agg.leave(10);
assertEquals(null, agg.getValue());
}
示例4: AggregatorMinMax
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
/**
* Ctor.
*
* @param minMaxTypeEnum - enum indicating to return minimum or maximum values
* @param returnType - is the value type returned by aggregator
*/
public AggregatorMinMax(MinMaxTypeEnum minMaxTypeEnum, Class returnType)
{
this.minMaxTypeEnum = minMaxTypeEnum;
this.returnType = returnType;
this.refSet = new SortedRefCountedSet<Object>();
}
示例5: getValue
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public Object getValue()
{
if (minMaxTypeEnum == MinMaxTypeEnum.MAX)
{
return refSet.maxValue();
}
else
{
return refSet.minValue();
}
}
示例6: ExprMinMaxAggrNodeFactory
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public ExprMinMaxAggrNodeFactory(MinMaxTypeEnum minMaxTypeEnum, Class type, boolean hasDataWindows, boolean distinct, boolean hasFilter) {
this.minMaxTypeEnum = minMaxTypeEnum;
this.type = type;
this.hasDataWindows = hasDataWindows;
this.distinct = distinct;
this.hasFilter = hasFilter;
}
示例7: ExprMinMaxAggrNode
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
/**
* Ctor.
* @param distinct - indicator whether distinct values of all values min/max
* @param minMaxTypeEnum - enum for whether to minimum or maximum compute
*/
public ExprMinMaxAggrNode(boolean distinct, MinMaxTypeEnum minMaxTypeEnum, boolean hasFilter)
{
super(distinct);
this.minMaxTypeEnum = minMaxTypeEnum;
this.hasFilter = hasFilter;
}
示例8: makeMinMaxAggregator
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public AggregationMethod makeMinMaxAggregator(int agentInstanceId, int groupId, int aggregationId, MinMaxTypeEnum minMaxTypeEnum, Class targetType, boolean isHasDataWindows, boolean hasFilter)
{
if (!hasFilter) {
if (!isHasDataWindows) {
return new AggregatorMinMaxEver(minMaxTypeEnum, targetType);
}
return new AggregatorMinMax(minMaxTypeEnum, targetType);
}
else {
if (!isHasDataWindows) {
return new AggregatorMinMaxEverFilter(minMaxTypeEnum, targetType);
}
return new AggregatorMinMaxFilter(minMaxTypeEnum, targetType);
}
}
示例9: setUp
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void setUp() throws Exception
{
maxNode = new ExprMinMaxAggrNode(false, MinMaxTypeEnum.MAX, false);
minNode = new ExprMinMaxAggrNode(false, MinMaxTypeEnum.MIN, false);
super.validatedNodeToTest = makeNode(MinMaxTypeEnum.MAX, 5, Integer.class);
}
示例10: testGetType
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testGetType() throws Exception
{
maxNode.addChildNode(new SupportExprNode(Integer.class));
SupportExprNodeFactory.validate3Stream(maxNode);
assertEquals(Integer.class, maxNode.getType());
minNode.addChildNode(new SupportExprNode(Float.class));
SupportExprNodeFactory.validate3Stream(minNode);
assertEquals(Float.class, minNode.getType());
maxNode = new ExprMinMaxAggrNode(false, MinMaxTypeEnum.MAX, false);
maxNode.addChildNode(new SupportExprNode(Short.class));
SupportExprNodeFactory.validate3Stream(maxNode);
assertEquals(Short.class, maxNode.getType());
}
示例11: makeNode
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
private ExprMinMaxAggrNode makeNode(MinMaxTypeEnum minMaxType, Object value, Class type) throws Exception
{
ExprMinMaxAggrNode minMaxNode = new ExprMinMaxAggrNode(false, minMaxType, false);
minMaxNode.addChildNode(new SupportExprNode(value, type));
SupportExprNodeFactory.validate3Stream(minMaxNode);
return minMaxNode;
}
示例12: testEvaluate
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testEvaluate() throws Exception
{
minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX);
setupNode(minMaxNode, 10, 1.5, null);
assertEquals(10d, minMaxNode.evaluate(null, false, null));
minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX);
setupNode(minMaxNode, 1, 1.5, null);
assertEquals(1.5d, minMaxNode.evaluate(null, false, null));
minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MIN);
setupNode(minMaxNode, 1, 1.5, null);
assertEquals(1d, minMaxNode.evaluate(null, false, null));
minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX);
setupNode(minMaxNode, 1, 1.5, 2.0f);
assertEquals(2.0d, minMaxNode.evaluate(null, false, null));
minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MIN);
setupNode(minMaxNode, 6, 3.5, 2.0f);
assertEquals(2.0d, minMaxNode.evaluate(null, false, null));
minMaxNode = makeNode(null, Integer.class, 5, Integer.class, 6, Integer.class);
assertNull(minMaxNode.evaluate(null, false, null));
minMaxNode = makeNode(7, Integer.class, null, Integer.class, 6, Integer.class);
assertNull(minMaxNode.evaluate(null, false, null));
minMaxNode = makeNode(3, Integer.class, 5, Integer.class, null, Integer.class);
assertNull(minMaxNode.evaluate(null, false, null));
minMaxNode = makeNode(null, Integer.class, null, Integer.class, null, Integer.class);
assertNull(minMaxNode.evaluate(null, false, null));
}
示例13: makeNode
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
private ExprMinMaxRowNode makeNode(Object valueOne, Class typeOne,
Object valueTwo, Class typeTwo,
Object valueThree, Class typeThree) throws Exception
{
ExprMinMaxRowNode maxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX);
maxNode.addChildNode(new SupportExprNode(valueOne, typeOne));
maxNode.addChildNode(new SupportExprNode(valueTwo, typeTwo));
maxNode.addChildNode(new SupportExprNode(valueThree, typeThree));
maxNode.validate(ExprValidationContextFactory.makeEmpty());
return maxNode;
}
示例14: testEqualsNode
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testEqualsNode() throws Exception
{
assertTrue(notNode.equalsNode(notNode));
assertFalse(notNode.equalsNode(new ExprMinMaxRowNode(MinMaxTypeEnum.MIN)));
assertFalse(notNode.equalsNode(new ExprOrNode()));
assertTrue(notNode.equalsNode(new ExprNotNode()));
}
示例15: testEqualsNode
import com.espertech.esper.type.MinMaxTypeEnum; //导入依赖的package包/类
public void testEqualsNode() throws Exception
{
ExprPlugInAggFunctionNode otherOne = new ExprPlugInAggFunctionNode(false, new SupportPluginAggregationMethodOne(), "matrix");
ExprPlugInAggFunctionNode otherTwo = new ExprPlugInAggFunctionNode(false, new SupportPluginAggregationMethodOne(), "matrix2");
assertTrue(plugInNode.equalsNode(plugInNode));
assertFalse(plugInNode.equalsNode(new ExprMinMaxRowNode(MinMaxTypeEnum.MIN)));
assertTrue(otherOne.equalsNode(plugInNode));
assertFalse(otherTwo.equalsNode(plugInNode));
}