use of com.rockwellcollins.atc.agree.agree.ClosedTimeInterval 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);
}
Aggregations