Example usage for java.lang Character getType

List of usage examples for java.lang Character getType

Introduction

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

Prototype

public static int getType(int codePoint) 

Source Link

Document

Returns a value indicating a character's general category.

Usage

From source file:Main.java

public static void main(String[] args) {
    int cp1 = 0x0033, cp2 = 0x006e;

    int i1 = Character.getType(cp1);
    int i2 = Character.getType(cp2);

    // value 9 represents DECIMAL_DIGIT_NUMBER
    String str1 = "Category of cp1 is " + i1;
    //value 2 represents LOWERCASE_LETTER
    String str2 = "Category of cp2 is " + i2;

    // print i1, i2 values
    System.out.println(str1);/*from   w  ww.jav a 2 s  .com*/
    System.out.println(str2);
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.CONTROL == Character.getType(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*from ww  w  .ja v  a  2s.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.SURROGATE == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*  ww  w. j av  a 2 s  .c o  m*/
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (int ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.MODIFIER_LETTER == Character.getType(ch)) {
            System.out.println((char) ch);
        }//from   w  ww  .  ja  v a 2s. 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.MATH_SYMBOL == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from ww  w.  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.PRIVATE_USE == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/* w ww. j  a v  a  2s.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.OTHER_LETTER == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//ww w.j a va 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.OTHER_SYMBOL == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*from  w w  w . j  a  va 2 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.OTHER_NUMBER == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*  w  w w .  java2 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.LETTER_NUMBER == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from  ww w . jav a 2s .com
    }
}