Example usage for java.text ChoiceFormat getLimits

List of usage examples for java.text ChoiceFormat getLimits

Introduction

In this page you can find the example usage for java.text ChoiceFormat getLimits.

Prototype

public double[] getLimits() 

Source Link

Document

Get the limits passed in the constructor.

Usage

From source file:net.gtaun.wl.lang.BeanMessageFormat.java

/**
 * Do something TODO. //from w w  w .  j a  v a  2s . c om
 * <p> 
 * Details of the function. 
 * </p> 
 */
private void applyFormats(MessageFormat subFormat) {

    for (Format format : subFormat.getFormats()) {
        if (!(format instanceof ChoiceFormat)) {
            continue;
        }

        ChoiceFormat choice = (ChoiceFormat) format;
        String[] choiceFormats = (String[]) choice.getFormats();
        for (int i = 0; i < choiceFormats.length; i++) {
            String innerFormat = choiceFormats[i];
            if (innerFormat.contains("{")) {
                BeanMessageFormat recursive = new BeanMessageFormat(innerFormat, root);
                choiceFormats[i] = recursive.inner.toPattern();
            }
        }

        choice.setChoices(choice.getLimits(), choiceFormats);
    }
}

From source file:org.mypsycho.text.BeanMessageFormat.java

/**
 * Do something TODO.//from   www. ja  v  a 2 s. c om
 * <p>
 * Details of the function.
 * </p>
 */
private void applyFormats(java.text.MessageFormat subFormat) {

    for (Format format : subFormat.getFormats()) {
        if (!(format instanceof ChoiceFormat)) {
            continue;
        }

        ChoiceFormat choice = (ChoiceFormat) format;
        String[] choiceFormats = (String[]) choice.getFormats();
        for (int i = 0; i < choiceFormats.length; i++) {
            String innerFormat = choiceFormats[i];
            if (innerFormat.contains("{")) {
                BeanMessageFormat recursive = new BeanMessageFormat(innerFormat, root);
                choiceFormats[i] = recursive.inner.toPattern();
            }
        }

        choice.setChoices(choice.getLimits(), choiceFormats);
    }
}