Subversion Repository Public Repository

litesoft

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.common.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'));
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/common/shared/utils/CharacterUtils.java

Diff revisions: vs.
Revision Author Commited Message
964 GeorgeS picture GeorgeS Fri 01 Aug, 2014 03:18:23 +0000

!