Search in sources :

Example 1 with IntervalType

use of com.rockwellcollins.atc.agree.analysis.realtime.AgreePatternInterval.IntervalType in project AGREE by loonwerks.

the class AgreePatternBuilder method getIntervalType.

private AgreePatternInterval getIntervalType(TimeInterval interval) {
    if (interval == null) {
        return null;
    }
    Expr low = builder.doSwitch(interval.getLow());
    Expr high = builder.doSwitch(interval.getHigh());
    IntervalType type;
    if (interval instanceof OpenTimeInterval) {
        type = IntervalType.OPEN;
    } else if (interval instanceof OpenLeftTimeInterval) {
        type = IntervalType.OPEN_LEFT;
    } else if (interval instanceof OpenRightTimeInterval) {
        type = IntervalType.OPEN_RIGHT;
    } else if (interval instanceof ClosedTimeInterval) {
        type = IntervalType.CLOSED;
    } else {
        throw new AgreeException("Unhandled TimeInterval type: " + interval.getClass());
    }
    return new AgreePatternInterval(type, low, high);
}
Also used : ClosedTimeInterval(com.rockwellcollins.atc.agree.agree.ClosedTimeInterval) Expr(jkind.lustre.Expr) IntExpr(jkind.lustre.IntExpr) IdExpr(jkind.lustre.IdExpr) IntervalType(com.rockwellcollins.atc.agree.analysis.realtime.AgreePatternInterval.IntervalType) OpenLeftTimeInterval(com.rockwellcollins.atc.agree.agree.OpenLeftTimeInterval) OpenRightTimeInterval(com.rockwellcollins.atc.agree.agree.OpenRightTimeInterval) OpenTimeInterval(com.rockwellcollins.atc.agree.agree.OpenTimeInterval) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException)

Aggregations

ClosedTimeInterval (com.rockwellcollins.atc.agree.agree.ClosedTimeInterval)1 OpenLeftTimeInterval (com.rockwellcollins.atc.agree.agree.OpenLeftTimeInterval)1 OpenRightTimeInterval (com.rockwellcollins.atc.agree.agree.OpenRightTimeInterval)1 OpenTimeInterval (com.rockwellcollins.atc.agree.agree.OpenTimeInterval)1 AgreeException (com.rockwellcollins.atc.agree.analysis.AgreeException)1 IntervalType (com.rockwellcollins.atc.agree.analysis.realtime.AgreePatternInterval.IntervalType)1 Expr (jkind.lustre.Expr)1 IdExpr (jkind.lustre.IdExpr)1 IntExpr (jkind.lustre.IntExpr)1