Package jflex
Class Interval
java.lang.Object
jflex.Interval
An interval of characters with basic operations.
- Version:
- JFlex 1.7.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int point) Returntrue
iffpoint
is contained in this interval.boolean
Returntrue
iff this interval completely contains the other one.copy()
Make a copy of this interval.boolean
private static boolean
isPrintable
(int c) Check whether a character is printable.void
setEnd
(int end) Set a new last charactervoid
setStart
(int start) Set a new first charactertoString()
Get a String representation of this interval.
-
Field Details
-
start
public int start -
end
public int end
-
-
Constructor Details
-
Interval
public Interval(int start, int end) Construct a new interval fromstart
toend
.- Parameters:
start
- first character the interval should containend
- last character the interval should contain
-
Interval
Copy constructor.- Parameters:
other
- aInterval
object.
-
-
Method Details
-
contains
public boolean contains(int point) Returntrue
iffpoint
is contained in this interval.- Parameters:
point
- the character to check- Returns:
- whether the codepoint is contained in the interval.
-
contains
Returntrue
iff this interval completely contains the other one.- Parameters:
other
- the other interval- Returns:
- whether this interval completely contains the other one.
-
equals
Return
true
ifo
is an interval with the same borders. -
setEnd
public void setEnd(int end) Set a new last character- Parameters:
end
- the new last character of this interval
-
setStart
public void setStart(int start) Set a new first character- Parameters:
start
- the new first character of this interval
-
isPrintable
private static boolean isPrintable(int c) Check whether a character is printable.- Parameters:
c
- the character to check
-
toString
Get a String representation of this interval. -
copy
Make a copy of this interval.- Returns:
- the copy
-