public static IdRange parseRange(String range) {
        int pos = range.indexOf(':');
        try {
            if (pos == -1) {
                long value = parseLong(range);
                return new IdRange(value);
            } else {
                long lowVal = parseLong(range.substring(0, pos));
                long highVal = parseLong(range.substring(pos + 1));
                return new IdRange(lowVal, highVal);
            }
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Invalid message set " + range);
        }
    }
public static IdRange parseRange ( String range ) { int pos = range . indexOf ( ':' ) ; try { if ( pos == - 1 ) { long value = parseLong ( range ) ; return new IdRange ( value ) ; } else { long lowVal = parseLong ( range . substring ( 0 , pos ) ) ; long highVal = parseLong ( range . substring ( pos + 1 ) ) ; return new IdRange ( lowVal , highVal ) ; } } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Invalid message set " + range ) ; } }
Parses a single id range, eg "1" or "1:2" or "4:*".

@param range the range.
@return the parsed id range.