JFlex
Class Interval
public final class Interval
extends java.lang.Object
An intervall of characters with basic operations.
boolean | contains(Interval other) - Return
true iff this intervall completely contains the
other one.
|
boolean | contains(char point) - Return
true iff point is contained in this intervall.
|
Interval | copy() - Make a copy of this interval.
|
boolean | equals(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
|
String | toString() - Get a String representation of this intervall.
|
Interval
public Interval(Interval other)
Copy constructor
Interval
public Interval(char start,
char end)
Constuct a new intervall from start
to end
.
start
- first character the intervall should containend
- last character the intervall should contain
contains
public boolean contains(Interval other)
Return true
iff this intervall completely contains the
other one.
other
- the other intervall
contains
public boolean contains(char point)
Return true
iff point
is contained in this intervall.
point
- the character to check
copy
public Interval copy()
Make a copy of this interval.
equals
public boolean equals(Object o)
Return true
if o
is an intervall
with the same borders.
o
- the object to check equality with
setEnd
public void setEnd(char end)
Set a new last character
end
- the new last character of this intervall
setStart
public void setStart(char start)
Set a new first character
start
- the new first character of this intervall
toString
public String toString()
Get a String representation of this intervall.
- a string
"[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'
.