litesoft
@ 948
litesoft / trunk / GWT_Sandbox / FormEngine / src / com / temp / shared / utils / CharacterUtils.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
package com.temp.shared.utils; public class CharacterUtils { public static final int NEWLINE = 10; public static final int DEL = 127; public static final int HIBIT_SPACE = 160; private static final String UNACCEPTABLE_NON_CONTROL_FILENAME_CHARACTERS = "|\\?*<\":>+[]/"; public static boolean isUnacceptableNonControlFilenameChar( char c ) { return (UNACCEPTABLE_NON_CONTROL_FILENAME_CHARACTERS.indexOf( c ) != -1); } public static boolean isControlChar( char c ) { return (c < ' ') || ((DEL <= c) && (c < HIBIT_SPACE)); } public static boolean isDisplayable7BitAsciiAllowingSpaceAndNewline( char c ) { return (c == NEWLINE) || ((' ' <= c) && (c <= DEL)); } public static boolean isAlphaNumericUnderScore7BitAscii( char c ) { return isNumeric( c ) || is7BitAlphaUnderScore( c ); } public static boolean is7BitAlphaUnderScore( char c ) { return (c == '_') || is7BitAlpha( c ); } public static boolean is7BitAlphaNumeric( char c ) { return isNumeric( c ) || is7BitAlpha( c ); } public static boolean is7BitAlpha( char c ) { return ((('A' <= c) && (c <= 'Z')) || (('a' <= c) && (c <= 'z'))); } public static boolean isNumeric( char c ) { return (('0' <= c) && (c <= '9')); } } |