question: private boolean verify ( String value , int allowedMask , char [ ] allowedChars , int minLength , int maxLength ) { if ( ( minLength != - 1 ) && ( value . length ( ) < minLength ) ) { return false ; } if ( ( maxLength != - 1 ) && ( value . length ( ) > maxLength ) ) { return false ; } int i = 0 ; while ( i < value . length ( ) ) { boolean found = false ; char ch = value . charAt ( i ) ; if ( ( allowedMask & HEX ) != 0 ) { if ( ( ( ch >= '0' ) && ( ch <= '9' ) ) || ( ( ch >= 'A' ) && ( ch <= 'F' ) ) || ( ( ch >= 'a' ) && ( ch <= 'f' ) ) ) { found = true ; } } if ( ( allowedMask & DIGITS ) != 0 ) { if ( ( ( ch >= '0' ) && ( ch <= '9' ) ) ) { found = true ; } else if ( ( i == 0 ) && ( ( ch == '-' ) || ( ch == '+' ) ) ) { found = true ; } } if ( ( ! found ) && ( ( allowedMask & ABC ) != 0 ) ) { if ( ( ( ch >= 'a' ) && ( ch <= 'z' ) ) || ( ( ch >= 'A' ) && ( ch <= 'Z' ) ) ) { found = true ; } } if ( ( ! found ) && ( allowedChars != null ) ) { int c = 0 ; while ( ( ! found ) && ( c < allowedChars . length ) ) { if ( ch == allowedChars [ c ] ) { found = true ; } else { c ++ ; } } } if ( ! found ) { return false ; } i ++ ; } return true ; }
target:  Verifies that the specified string conforms with the specified restrictions.