public class Range
extends java.lang.Object
Object can be treated as a sub-list of indices. One (low) value is less or equal than another (high) value.
Constructor and Description |
---|
Range(IntegerRange integerRange)
Constructs a copy of the specified range.
|
Range(int low,
int high)
Creates range with the specified low and high indices.
|
Range(ru.ispras.fortress.expression.Node low,
ru.ispras.fortress.expression.Node high)
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 |
getHigh()
Returns high index.
|
ru.ispras.fortress.expression.Node |
getLow()
Returns low index.
|
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> |
getVariables()
Returns variables that are used in this object.
|
int |
hashCode() |
boolean |
isConstantRange()
Checks whether this range has constant borders.
|
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 low, ru.ispras.fortress.expression.Node high)
low
- low indexhigh
- high 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 low, int high)
low
- The smaller (low) index value.high
- The bigger (high) index value.public Range(IntegerRange integerRange)
integerRange
- The integer range.public Range deepCopy()
public ru.ispras.fortress.expression.Node getLow()
public ru.ispras.fortress.expression.Node getHigh()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getVariables()
public boolean isConstantRange()
true
when this range has constant borders, false
otherwise.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