class NRange extends Object implements Comparable<NRange>
Modifier and Type | Field and Description |
---|---|
int |
start
The range's start position.
|
int |
stop
The range's stop position.
|
Constructor and Description |
---|
NRange(int start,
int stop)
Construct a liveness range extending from start to stop (positions in the
code).
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(NRange other)
One liveness range comes before another if its start position comes
before the other's start position.
|
boolean |
rangeOverlaps(NRange a)
Does this liveness range overlap with another?
|
NRange |
splitRange(int newStart,
int oldStop)
Mutates current range to be only as long as the split point and returns
the remainder as a new range.
|
String |
toString()
The string representation of the range.
|
public int start
public int stop
public NRange(int start, int stop)
start
- start position.stop
- stop position.public NRange splitRange(int newStart, int oldStop)
newStart
- the split locationoldStop
- the split locationpublic boolean rangeOverlaps(NRange a)
a
- The other range.public int compareTo(NRange other)
compareTo
in interface Comparable<NRange>
other
- the other range.