public final class Interval
extends java.lang.Object
Constructor and Description |
---|
Interval(char start,
char end)
Constuct a new intervall from
start to end . |
Interval(Interval other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(char point)
Return
true iff point is contained in this intervall. |
boolean |
contains(Interval other)
Return
true iff this intervall completely contains the
other one. |
Interval |
copy()
Make a copy of this interval.
|
boolean |
equals(java.lang.Object o)
Return
true if o is an intervall
with the same borders. |
void |
setEnd(char end)
Set a new last character
|
void |
setStart(char start)
Set a new first character
|
java.lang.String |
toString()
Get a String representation of this intervall.
|
public Interval(char start, char end)
start
to end
.start
- first character the intervall should containend
- last character the intervall should containpublic Interval(Interval other)
public boolean contains(char point)
true
iff point
is contained in this intervall.point
- the character to checkpublic boolean contains(Interval other)
true
iff this intervall completely contains the
other one.other
- the other intervallpublic boolean equals(java.lang.Object o)
true
if o
is an intervall
with the same borders.equals
in class java.lang.Object
o
- the object to check equality withpublic void setEnd(char end)
end
- the new last character of this intervallpublic void setStart(char start)
start
- the new first character of this intervallpublic java.lang.String toString()
toString
in class java.lang.Object
"[start-end]"
or
"[start]"
(if there is only one character in
the intervall) where start
and
end
are either a number (the character code)
or something of the from 'a'
.public Interval copy()