private boolean isValidCharForPath ( char c , boolean openedKey ) { char [ ] invalidChars = { ' ' , ' ' , ' ' } ; for ( char invalidChar : invalidChars ) { if ( c == invalidChar ) { return false ; } } if ( openedKey ) { char [ ] moreInvalidChars = { ' ' , ' ' } ; for ( char invalidChar : moreInvalidChars ) { if ( c == invalidChar ) { return false ; } } } return true ; }
Helper method . Tells if a char is valid in a the path of a route line .