Class CharRange
java.lang.Object
org.getalp.dbnary.tools.CharRange
Simmplified from org apache commons lang 2.5.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(char c) check if a char is inside the current range.booleancontains(int c) check if a code point is inside the current range.intgetEnd()Gets the end character for this character range.intgetStart()Gets the start character for this character range.toString()Gets a string representation of the character range.
-
Constructor Details
-
CharRange
public CharRange(char ch) Constructs a
CharRangeover a single character.- Parameters:
ch- only character in this range
-
CharRange
public CharRange(int start, int end) Constructs a
CharRangeover a set of characters.- Parameters:
start- first character, inclusive, in this rangeend- last character, inclusive, in this range
-
-
Method Details
-
getStart
public int getStart()Gets the start character for this character range.
- Returns:
- the start char (inclusive)
-
getEnd
public int getEnd()Gets the end character for this character range.
- Returns:
- the end char (inclusive)
-
contains
public boolean contains(char c) check if a char is inside the current range.
- Parameters:
c- the character to check- Returns:
- true if the range contains c
-
contains
public boolean contains(int c) check if a code point is inside the current range.
- Parameters:
c- the code point to check- Returns:
- true if the range contains c
-
toString
-