Example usage for java.lang Character getDirectionality

List of usage examples for java.lang Character getDirectionality

Introduction

In this page you can find the example usage for java.lang Character getDirectionality.

Prototype

public static byte getDirectionality(int codePoint) 

Source Link

Document

Returns the Unicode directionality property for the given character (Unicode code point).

Usage

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from  ww w.ja  va2s  .  com
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from w  w w  .  ja v  a2 s . co  m
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*from  w ww . ja v  a 2 s  .  c om*/
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from w ww .  j a v  a2  s  .com
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*w w  w . java 2 s .  c  o m*/
    }
}

From source file:Main.java

public static boolean isRTL() {
    final int directionality = Character.getDirectionality(Locale.getDefault().getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:Main.java

public static boolean isRTL(Locale locale) {
    final int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:Main.java

private static boolean isRTL(Locale locale) {
    int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:com.hustunique.jianguo.materialsearchview.SearchViewUtil.java

private static boolean isRTL(Locale locale) {
    final int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:Main.java

public static boolean isStrongLeftToRight(char c) {
    byte dir = Character.getDirectionality(c);
    return (dir == Character.DIRECTIONALITY_LEFT_TO_RIGHT)
            || (dir == Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING)
            || (dir == Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE);
}