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) {
    char ch1 = 'M', ch2 = '\u06aa';

    byte b1 = Character.getDirectionality(ch1);
    byte b2 = Character.getDirectionality(ch2);

    if (b1 == 0) {
        System.out.println("DIRECTIONALITY_LEFT_TO_RIGHT");
    }/*from ww w.  j  ava  2s .  c  o m*/
    if (b2 == 2) {
        System.out.println("DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC");
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.FORMAT == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//ww  w  .  j a  va 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.ENCLOSING_MARK == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from ww  w . j a v a  2 s  . c o 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.END_PUNCTUATION == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from   www.ja va 2  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.TITLECASE_LETTER == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from  w  ww  .java 2  s. c  o  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.FINAL_QUOTE_PUNCTUATION == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//w w w .  j a v  a 2 s  . c  o 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_UNDEFINED == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//w  ww. j ava2s  .  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_WHITESPACE == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from ww  w  .j a  v a 2  s.c  o 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 == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//w  ww . j av a2  s  . c  o 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_LEFT_TO_RIGHT == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from   w  ww  .ja v a  2  s  .  c o m
    }
}