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 booleanequals(Object obj)intgetFrom()Gets the from value, inclusive.intgetTo()Gets the to value, inclusive.inthashCode()booleaninRange(int value)Test if a value is in range.static RangeparseRange(String range)Parses the string as a range.StringtoString()
-
-
-
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
-
-