public class Range
extends java.lang.Object
Object can be treated as a sub-list of indices. One (young) value is less or equal than another (old) value.
Constructor and Description |
---|
Range(int young,
int old)
Creates range with the specified young and old indices.
|
Range(ru.ispras.fortress.expression.Node young,
ru.ispras.fortress.expression.Node old)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Range |
deepCopy()
Creates a deep copy of the current object.
|
boolean |
equals(java.lang.Object obj) |
ru.ispras.fortress.expression.Node |
getOld()
Returns old index.
|
static Range |
getRangeInvariant(ru.ispras.fortress.expression.Node left,
ru.ispras.fortress.expression.Node right,
boolean isAscending)
Returns the invariant in range form.
|
ru.ispras.fortress.expression.Node |
getYoung()
Returns young index.
|
int |
hashCode() |
boolean |
isIntegerRange()
Checks whether this object is a range of integer values.
|
IntegerRange |
toIntegerRange()
Converts this object to integer range, if fails, returns
null . |
java.lang.String |
toString() |
public Range(ru.ispras.fortress.expression.Node young, ru.ispras.fortress.expression.Node old)
young
- young indexold
- old indexjava.lang.IllegalArgumentException
- in the following situations:
(1) when any of the arguments is null
;
(2) when the second argument is always less than first argument.public Range(int young, int old)
young
- The smaller (young) index value.old
- The bigger (old) index value.public static Range getRangeInvariant(ru.ispras.fortress.expression.Node left, ru.ispras.fortress.expression.Node right, boolean isAscending)
left
- The first border of the range invariant.right
- The second border of the ranged invariant.isAscending
- Flag that shows whether second border is greater than the first one.public Range deepCopy()
public ru.ispras.fortress.expression.Node getYoung()
public ru.ispras.fortress.expression.Node getOld()
public boolean isIntegerRange()
true
if this object is integer value range, false
otherwise.public IntegerRange toIntegerRange()
null
.null
, if fails.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object