Package java.text

Examples of java.text.ChoiceFormat.format()


  public void test_formatL() {
    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");

    assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE));
    assertEquals("NEGATIVE_ONE", fmt.format(-1));
    assertEquals("ZERO", fmt.format(0));
    assertEquals("ONE", fmt.format(1));
    assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE));
  }
 
View Full Code Here


    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");

    assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE));
    assertEquals("NEGATIVE_ONE", fmt.format(-1));
    assertEquals("ZERO", fmt.format(0));
    assertEquals("ONE", fmt.format(1));
    assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE));
  }
 
  /**
 
View Full Code Here

        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");

    assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE));
    assertEquals("NEGATIVE_ONE", fmt.format(-1));
    assertEquals("ZERO", fmt.format(0));
    assertEquals("ONE", fmt.format(1));
    assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE));
  }
 
  /**
   * @tests java.text.ChoiceFormat#format(double)
View Full Code Here

    assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE));
    assertEquals("NEGATIVE_ONE", fmt.format(-1));
    assertEquals("ZERO", fmt.format(0));
    assertEquals("ONE", fmt.format(1));
    assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE));
  }
 
  /**
   * @tests java.text.ChoiceFormat#format(double)
   */
 
View Full Code Here

   * @tests java.text.ChoiceFormat#format(double)
   */
  public void test_formatD() {
    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");
    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
View Full Code Here

   */
  public void test_formatD() {
    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");
    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
    assertEquals("ZERO", fmt.format(0.9));
View Full Code Here

  public void test_formatD() {
    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");
    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
    assertEquals("ZERO", fmt.format(0.9));
    assertEquals("ONE", fmt.format(1.0));
View Full Code Here

    ChoiceFormat fmt = new ChoiceFormat(
        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");
    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
    assertEquals("ZERO", fmt.format(0.9));
    assertEquals("ONE", fmt.format(1.0));
    assertEquals("GREATER_THAN_ONE", fmt.format(1.1));
View Full Code Here

        "-1#NEGATIVE_ONE|0#ZERO|1#ONE|1<GREATER_THAN_ONE");
    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
    assertEquals("ZERO", fmt.format(0.9));
    assertEquals("ONE", fmt.format(1.0));
    assertEquals("GREATER_THAN_ONE", fmt.format(1.1));
    assertEquals("GREATER_THAN_ONE", fmt.format(999999999D));
View Full Code Here

    assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY));
    assertEquals("NEGATIVE_ONE", fmt.format(-999999999D));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.1));
    assertEquals("NEGATIVE_ONE", fmt.format(-1.0));
    assertEquals("NEGATIVE_ONE", fmt.format(-0.9));
    assertEquals("ZERO", fmt.format(0.0));
    assertEquals("ZERO", fmt.format(0.9));
    assertEquals("ONE", fmt.format(1.0));
    assertEquals("GREATER_THAN_ONE", fmt.format(1.1));
    assertEquals("GREATER_THAN_ONE", fmt.format(999999999D));
    assertEquals("GREATER_THAN_ONE", fmt.format(Double.POSITIVE_INFINITY));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.