Package com.ibm.icu.text

Examples of com.ibm.icu.text.MessageFormat.format()


            log("format(null) : ");
            logln("\"" + mf.format(objs1) + "\"");
            log("format({})   : ");
            logln("\"" + mf.format(objs2) + "\"");
            log("format({null}) :");
            logln("\"" + mf.format(objs3) + "\"");
        } catch (Exception e) {
            errln("Exception thrown for null argument tests.");
        }
    }{ // Taken from Test4118594().
        String argName = "something_stupid";
View Full Code Here


            errln("argument0: \"" + objs.get(argName) + "\"");
        mf.setLocale(Locale.US);
        mf.applyPattern("{" + argName + ",number,#.##}, {" + argName + ",number,#.#}");
        Map oldobjs = new HashMap();
        oldobjs.put(argName, new Double(3.1415));
        String result = mf.format( oldobjs );
        logln("pattern: \"" + mf.toPattern() + "\"");
        logln("text for parsing: \"" + result + "\"");
        // result now equals "3.14, 3.1"
        if (!result.equals("3.14, 3.1"))
            errln("result = " + result);
View Full Code Here

        form2.setFormat(0, fileform);
        Map testArgs = new HashMap();
        testArgs.put("diskName", "MyDisk");
        testArgs.put("numberOfFiles", new Long(12373));
        logln(form1.format(testArgs));
        logln(form2.format(testArgs));
    }{ // Taken from test4293229().
        MessageFormat format = new MessageFormat("'''{'myNamedArgument}'' '''{myNamedArgument}'''");
        Map args = new HashMap();
        String expected = "'{myNamedArgument}' '{myNamedArgument}'";
        String result = format.format(args);
View Full Code Here

        logln(form2.format(testArgs));
    }{ // Taken from test4293229().
        MessageFormat format = new MessageFormat("'''{'myNamedArgument}'' '''{myNamedArgument}'''");
        Map args = new HashMap();
        String expected = "'{myNamedArgument}' '{myNamedArgument}'";
        String result = format.format(args);
        if (!result.equals(expected)) {
            throw new RuntimeException("wrong format result - expected \"" +
                    expected + "\", got \"" + result + "\"");
        }
    }
View Full Code Here

             numberOfScripts = Integer.parseInt(checkICUVersion.substring(checkICUVersion.indexOf("=")+1));
            
             Object args[] = {new Integer(previousMajor), new Integer(previousMinor)};
             //Check for the initial header. It should be written only one time
             if(!initialheader){
                 output.println(format.format(args));
                 initialheader = true;
             }else{
                 if((verMajor-previousMajor)>=1){
                     format = new MessageFormat(scriptPreambleStable);
                     output.println(format.format(args));
View Full Code Here

                 output.println(format.format(args));
                 initialheader = true;
             }else{
                 if((verMajor-previousMajor)>=1){
                     format = new MessageFormat(scriptPreambleStable);
                     output.println(format.format(args));
                 }else{
                     format = new MessageFormat(scriptPreambleDraft);
                     output.println(format.format(args));
                 }
             }
View Full Code Here

                 if((verMajor-previousMajor)>=1){
                     format = new MessageFormat(scriptPreambleStable);
                     output.println(format.format(args));
                 }else{
                     format = new MessageFormat(scriptPreambleDraft);
                     output.println(format.format(args));
                 }
             }
            
             for(int i=0;i<numberOfScripts;i++){
                 output.print("    ");
View Full Code Here

        }
       
        if(newScripts){//Processing newly added scripts
            format = new MessageFormat(scriptPreambleDraft);
            Object args[] = {new Integer(verMajor), new Integer(verMinor)};
            output.println(format.format(args));
           
            for (int script = previousTotalScripts+1; script <= totalScript; script += 1) {
                output.print("    ");
                output.print(scriptData.getTagLabel(script));
                output.print("ScriptCode = ");
View Full Code Here

            
             Object args[] = {new Integer(previousMajor), new Integer(previousMinor)};
           
             //Check for the initial header. It should be written only one time
             if(!initialheader){
                 output.println(format.format(args));
                 initialheader = true;
             }else{
                 if((verMajor-previousMajor)>=1){
                     format = new MessageFormat(languagePreambleStable);
                     output.println(format.format(args));
View Full Code Here

                 output.println(format.format(args));
                 initialheader = true;
             }else{
                 if((verMajor-previousMajor)>=1){
                     format = new MessageFormat(languagePreambleStable);
                     output.println(format.format(args));
                 }else{
                     format = new MessageFormat(languagePreambleDraft);
                     output.println(format.format(args));
                 }
             }
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.