Java Code Examples for java.text.ChoiceFormat#setChoices()

The following examples show how to use java.text.ChoiceFormat#setChoices() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChoiceFormatTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * @tests java.text.ChoiceFormat#clone()
 */
public void test_clone() {
    // Test for method java.lang.Object java.text.ChoiceFormat.clone()
    ChoiceFormat f = (ChoiceFormat) f1.clone();
    assertTrue("Not equal", f.equals(f1));
    f.setChoices(new double[] { 0, 1, 2 }, new String[] { "0", "1", "2" });
    assertTrue("Equal", !f.equals(f1));
}
 
Example 2
Source File: ChoiceFormatTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * @tests java.text.ChoiceFormat#setChoices(double[], java.lang.String[])
 */
public void test_setChoices$D$Ljava_lang_String() {
    // Test for method void java.text.ChoiceFormat.setChoices(double [],
    // java.lang.String [])
    ChoiceFormat f = (ChoiceFormat) f1.clone();
    double[] l = new double[] { 0, 1 };
    String[] fs = new String[] { "0", "1" };
    f.setChoices(l, fs);
    assertTrue("Limits copied", f.getLimits() == l);
    assertTrue("Formats copied", f.getFormats() == fs);
}