public final class Interval extends Object
| Constructor and Description |
|---|
Interval(Interval other)
Copy constructor
|
Interval(int start,
int end)
Constuct a new interval from
start to end. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int point)
Return
true iff point is contained in this interval. |
boolean |
contains(Interval other)
Return
true iff this interval completely contains the
other one. |
Interval |
copy()
Make a copy of this interval.
|
boolean |
equals(Object o)
Return
true if o is an interval
with the same borders. |
void |
setEnd(int end)
Set a new last character
|
void |
setStart(int start)
Set a new first character
|
String |
toString()
Get a String representation of this interval.
|
public Interval(int start,
int end)
start to end.start - first character the interval should containend - last character the interval should containpublic Interval(Interval other)
public boolean contains(int point)
true iff point is contained in this interval.point - the character to checkpublic boolean contains(Interval other)
true iff this interval completely contains the
other one.other - the other intervalpublic boolean equals(Object o)
true if o is an interval
with the same borders.public void setEnd(int end)
end - the new last character of this intervalpublic void setStart(int start)
start - the new first character of this intervalpublic String toString()
public Interval copy()
Copyright © 2015. All rights reserved.