class RangeOption implements Comparable<RangeOption> {

    public static RangeOption parse(String option) {
        Matcher rangeMatcher = RANGE_PATTERN.matcher(option);

        rangeMatcher.find();

        if (!rangeMatcher.matches()) {
            return null;
        }

        String initialStr = rangeMatcher.group(1);

        int initial = Integer.parseInt(initialStr);
        int terminal = TERMINAL_MISSING;

        if (rangeMatcher.group(2) != null) {
            String terminalStr = rangeMatcher.group(3);

            if ("*".equals(terminalStr)) {
                terminal = TERMINAL_END_OF_RANGE;
            } else {
                terminal = Integer.parseInt(terminalStr);
            }
        }

        return new RangeOption(initial, terminal);
    }

    public  RangeOption(int initial);
    public  RangeOption(int initial, int terminal);

}