/*
***************************************************************************************
* Copyright (C) 2006 EsperTech, Inc. All rights reserved. *
* http://www.espertech.com/esper *
* http://www.espertech.com *
* ---------------------------------------------------------------------------------- *
* The software in this package is published under the terms of the GPL license *
* a copy of which has been included with this distribution in the license.txt file. *
***************************************************************************************
*/
package com.espertech.esper.epl.expression.time;
import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.util.TimePeriod;
import com.espertech.esper.epl.expression.core.ExprEvaluatorContext;
import com.espertech.esper.epl.expression.core.ExprNode;
/**
* Expression representing a time period.
* <p>
* Child nodes to this expression carry the actual parts and must return a numeric value.
*/
public interface ExprTimePeriod extends ExprNode {
public boolean hasVariable();
public ExprTimePeriodEvalDeltaConst constEvaluator(ExprEvaluatorContext context);
public ExprTimePeriodEvalDeltaNonConst nonconstEvaluator();
public double evaluateAsSeconds(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context);
public TimePeriod evaluateGetTimePeriod(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context);
/**
* Indicator whether the time period has a day part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasDay();
/**
* Indicator whether the time period has a hour part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasHour();
/**
* Indicator whether the time period has a minute part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasMinute();
/**
* Indicator whether the time period has a second part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasSecond();
/**
* Indicator whether the time period has a millisecond part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasMillisecond();
/**
* Indicator whether the time period has a microsecond part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasMicrosecond();
/**
* Indicator whether the time period has a year part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasYear();
/**
* Indicator whether the time period has a month part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasMonth();
/**
* Indicator whether the time period has a week part child expression.
*
* @return true for part present, false for not present
*/
public boolean isHasWeek();
public boolean isConstantResult();
}