private int [ ] getRange ( String field , int min , int max ) { int [ ] result = new int [ 2 ] ; if ( field . contains ( "*" ) ) { result [ 0 ] = min ; result [ 1 ] = max - 1 ; return result ; } if ( ! field . contains ( "-" ) ) { result [ 0 ] = result [ 1 ] = Integer . valueOf ( field ) ; } else { String [ ] split = StringUtils . delimitedListToStringArray ( field , "-" ) ; if ( split . length > 2 ) { throw new IllegalArgumentException ( "Range has more than two fields: '" + field + "' in expression \"" + this . expression + "\"" ) ; } result [ 0 ] = Integer . valueOf ( split [ 0 ] ) ; result [ 1 ] = Integer . valueOf ( split [ 1 ] ) ; } if ( result [ 0 ] >= max || result [ 1 ] >= max ) { throw new IllegalArgumentException ( "Range exceeds maximum (" + max + "): '" + field + "' in expression \"" + this . expression + "\"" ) ; } if ( result [ 0 ] < min || result [ 1 ] < min ) { throw new IllegalArgumentException ( "Range less than minimum (" + min + "): '" + field + "' in expression \"" + this . expression + "\"" ) ; } return result ; }
Gets the range .