Example usage for java.text Collator getDecomposition

List of usage examples for java.text Collator getDecomposition

Introduction

In this page you can find the example usage for java.text Collator getDecomposition.

Prototype

public synchronized int getDecomposition() 

Source Link

Document

Get the decomposition mode of this Collator.

Usage

From source file:Decomposition.java

public void compare(Collator c, String a, String b) {
    switch (c.getDecomposition()) {
    case Collator.NO_DECOMPOSITION:
        System.out.print(" NO DECOMPOSITION: ");
        break;//from  ww w.  j  a  va 2 s  . co  m
    case Collator.CANONICAL_DECOMPOSITION:
        System.out.print(" CANONICAL DECOMPOSITION: ");
        break;
    case Collator.FULL_DECOMPOSITION:
        System.out.print(" FULL DECOMPOSITION: ");
        break;
    default:
        System.out.print(" UNKNOWN DECOMPOSITION: ");
    }

    if (c.equals(a, b))
        System.out.println("The strings are equal.");
    else
        System.out.println("The strings are NOT equal.");
}