Package org.daisy.braille.utils.pef
Class Range
- java.lang.Object
-
- org.daisy.braille.utils.pef.Range
-
public final class Range extends Object
Provides a range data object.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getFrom()
Gets the from value, inclusive.int
getTo()
Gets the to value, inclusive.int
hashCode()
boolean
inRange(int value)
Test if a value is in range.static Range
parseRange(String range)
Parses the string as a range.String
toString()
-
-
-
Method Detail
-
parseRange
public static Range parseRange(String range)
Parses the string as a range.- Parameters:
range
- the range to parse- Returns:
- returns a Range object
- Throws:
NumberFormatException
- if the range cannot be parsed
-
inRange
public boolean inRange(int value)
Test if a value is in range.- Parameters:
value
- the value- Returns:
- returns true if value is in range, false otherwise
-
getFrom
public int getFrom()
Gets the from value, inclusive.- Returns:
- returns the from value
-
getTo
public int getTo()
Gets the to value, inclusive.- Returns:
- returns the to value
-
-