return (currentNumber != null) ? currentNumber : 0;
}
public Range readRange(String errorMessage) throws ParseError {
if (nextToken() != Token.KEY || (currentNumber == null && currentRange == null)) {
throw new ParseError(errorMessage);
} else if (!isRange && currentNumber != null) {
if (currentNumber >= 0) {
return new Range(currentNumber, currentNumber);
} else {
return new Range(0, Math.abs(currentNumber));
}
} else if (isRange && currentRange == null) {
return new Range(currentNumber, Integer.MAX_VALUE);
} else if (currentNumber != null && currentRange != null) {
return new Range(currentNumber, currentRange);
} else {
throw new ParseError(errorMessage);
}
}