public static CharRanges withRanges ( int ... ranges ) { if ( ( ranges . length & 1 ) != 0 ) { throw new IllegalArgumentException ( ) ; } for ( int i = 1 ; i < ranges . length ; ++ i ) { if ( ranges [ i ] <= ranges [ i - 1 ] ) { throw new IllegalArgumentException ( ranges [ i ] + " > " + ranges [ i - 1 ] ) ; } } return new CharRanges ( ranges ) ; }
Returns an instance containing the given ranges .