public class RangeExpression extends Expression
| Constructor and Description |
|---|
RangeExpression(Expression lb,
Expression ub)
Constructs a range expression with the given lower and upper bounds.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Expression e)
Compares the range expression with the specified expression for order.
|
static void |
defaultPrint(RangeExpression e,
java.io.PrintWriter o)
Prints the range expression on the specified print writer.
|
Expression |
getLB()
Returns the lower bound of this range expression.
|
static Expression |
getOmega()
Returns a new instanceof omega expression which is [-inf:inf].
|
Expression |
getSize()
Returns the size of the span bounded by this range expression.
|
Expression |
getUB()
Returns the upper bound of this range expression.
|
boolean |
isBounded()
Returns true if neither lb nor ub is infinity.
|
boolean |
isEmpty()
Checks if this range expression has a lower bound greater than the upper
bound.
|
boolean |
isOmega()
Checks if this range expression does not have any closed bounds.
|
void |
setLB(Expression lb)
Sets the lower bound with the specified expression.
|
void |
setUB(Expression ub)
Sets the upper bound with the specified expression.
|
Expression |
toExpression()
Converts this range expression to a non-range expression if the lower
bound is equal to the upper bound.
|
static RangeExpression |
toRange(Expression e)
Converts an arbitrary expression to a range expression by setting the same
lower bound and upper bound.
|
java.lang.String |
toString()
Returns a string representation of the range expression.
|
clone, equals, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic RangeExpression(Expression lb, Expression ub)
lb - the lower bound expression.ub - the upper bound expression.java.lang.IllegalArgumentException - if lb or ub is invalid.NotAnOrphanException - if lb or ub has a parent.public static void defaultPrint(RangeExpression e, java.io.PrintWriter o)
public java.lang.String toString()
defaultPrint(cetus.hir.RangeExpression, java.io.PrintWriter).toString in class Expressionpublic int compareTo(Expression e)
compareTo in interface java.lang.Comparable<Expression>compareTo in class Expressionpublic void setLB(Expression lb)
lb - the new lower bound.NotAnOrphanException - if lb has a parent.public void setUB(Expression ub)
ub - the new upper boundNotAnOrphanException - if ub has a parent.public Expression getLB()
public Expression getUB()
public boolean isEmpty()
public boolean isOmega()
public boolean isBounded()
public static RangeExpression toRange(Expression e)
public Expression toExpression()
public static Expression getOmega()
public Expression getSize()