當前位置: 首頁>>代碼示例>>Java>>正文


Java Locale.GERMAN屬性代碼示例

本文整理匯總了Java中java.util.Locale.GERMAN屬性的典型用法代碼示例。如果您正苦於以下問題:Java Locale.GERMAN屬性的具體用法?Java Locale.GERMAN怎麽用?Java Locale.GERMAN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.util.Locale的用法示例。


在下文中一共展示了Locale.GERMAN屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAsObject_GermanLocale

/**
 * Test for getting value for German local.
 */
@Test
public void getAsObject_GermanLocale() throws ConverterException {
    context = new FacesContextStub(Locale.GERMAN);

    String str = "1,23";
    UIComponent component = ConverterTestHelper.getComponent(false, null,
            null, "discount");
    BigDecimal expected = new BigDecimal("1.23");

    BigDecimal actual = (BigDecimal) converter.getAsObject(context,
            component, str);

    assertEquals(expected, actual);
    context = new FacesContextStub(Locale.ENGLISH);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:18,代碼來源:BigDecimalConverterTest.java

示例2: _getDataForPatterns

private Object[][] _getDataForPatterns()
{
  // pattern, inputvalue,locale,timezone
  Object[][] data =
  {
    {"yyyy.MM.dd G 'at' HH:mm:ss z", "2001.07.04 AD at 12:08:56 PDT", Locale.US, null },

    {"EEE, MMM d, ''yy","Wed, Jul 4, '01", Locale.ENGLISH, getTzone("GMT")},

    {"h:mm a","12:08 PM", Locale.GERMAN, getTzone("GMT+1")},

    {"hh 'o''clock' a, zzzz","12 o'clock PM, Pacific Standard Time", Locale.CANADA, getTzone("GMT-8")},

    {"K:mm a, z","0:08 PM, PST", Locale.US, getTzone("PST")},

    {"yyyyy.MMMMM.dd GGG hh:mm aaa","02001.July.04 AD 12:08 PM", Locale.US, null},
    {"EEE, d MMM yyyy HH:mm:ss Z","Wed, 4 Jul 2001 12:08:56 GMT",Locale.US, getTzone("GMT")},
    {"yyMMddHHmmss", "010704120856", Locale.ENGLISH, null, null},

  };
  return data;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:22,代碼來源:TrinidadDateTimeConverterTest.java

示例3: testParse_GermanLocaleOwnOutput

@Test
public void testParse_GermanLocaleOwnOutput() throws Exception {
    PriceConverter converter = new PriceConverter(Locale.GERMAN);
    Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
    long price = 50L;
    String valueToDisplay = converter.getValueToDisplay(new BigDecimal(
            price), true);
    BigDecimal valueToStore = converter.parse(valueToDisplay);
    checkEquals("50.00", valueToStore);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:PriceConverterTest.java

示例4: redirectSystemOutput

/**
 * 
 * @param toFile
 */
public void redirectSystemOutput(boolean toFile) {
    try {
    	if (toFile) {
    		Log.i(DEBUG_TAG,"redirecting sysout to file");
    		//Redirecting console output and runtime exceptions to file (System.out.println)
    		File f = new File(Environment.getExternalStorageDirectory(), "qosdebug");
    		if (!f.exists()) {
    			f.mkdir();
    		}
        
    		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", Locale.GERMAN);
    		//PrintStream fileStream = new PrintStream(new File(f, sdf.format(new Date()) + ".txt"));
    		PrintStream fileStream = new DebugPrintStream(new File(f, sdf.format(new Date()) + ".txt"));
         
    		//System.setOut(fileStream);
            System.setErr(fileStream);
    	}
    	else {        		
    		//Redirecting console output and runtime exceptions to default output stream
            //System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
            //System.setErr(new PrintStream(new FileOutputStream(FileDescriptor.err)));
            //Log.i(DEBUG_TAG,"redirecting sysout to default");
    	}
    }
    catch (Exception e) {
    	e.printStackTrace();
    }
}
 
開發者ID:rtr-nettest,項目名稱:open-rmbt,代碼行數:32,代碼來源:RMBTMainActivity.java

示例5: testValidate_DurationFloatInputGerman

@Test(expected = ValidatorException.class)
public void testValidate_DurationFloatInputGerman() throws Exception {
    context = new FacesContextStub(Locale.GERMAN);
    UIComponentStub stub = getComponent(DATATYPE_DURATION, false, null,
            null);
    validator.validate(context, stub, "1,1");
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:7,代碼來源:ParameterValueValidatorTest.java

示例6: main

public static void main(String args[]) {
    Bug8154797.generateExpectedValues();
    Locale[] locArr = {new Locale("hi", "IN"), Locale.UK, new Locale("fi", "FI"),
                       Locale.ROOT, Locale.GERMAN, Locale.JAPANESE,
                       Locale.ENGLISH, Locale.FRANCE};
    for (Locale loc : locArr) {
        Bug8154797.compareResources(loc);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:Bug8154797.java

示例7: doInBackground

@Override
@SuppressLint("DefaultLocale")
protected Bitmap doInBackground(Void... params) {

    if (!EssensbonUtils.isLoggedIn())
        return null;

    if (hasActiveInternetConnection()) {
        if (onAppStart) {
            if (EssensbonUtils.isAutoSyncEnabled())
                saveNewestEntries();
        } else
            saveNewestEntries();
    }

    Order act = getRecentEntry();
    if (act == null)
        return null;

    menu = act.getMenu();
    description = act.getDescr();
    short id = act.getId();

    DateFormat dateFormat = new SimpleDateFormat("ddMMyyy", Locale.GERMAN);
    Date       date       = new Date();
    String     dateS      = dateFormat.format(date);
    dateS = dateS.substring(0, 4) + dateS.substring(5);

    int cur = Integer.parseInt(dateS)+id;
    int mod = cur%97;
    int fin = 98-mod;

    String formattedChecksum = String.format("%02d", fin);

    String code = id+"-"+"M"+menu+"-"+dateS+"-"+formattedChecksum;

    return createNewQR(code);
}
 
開發者ID:LCA311,項目名稱:leoapp-sources,代碼行數:38,代碼來源:QRWriteTask.java

示例8: data_localeList

@DataProvider(name = "localeList")
Locale[] data_localeList() {
    return new Locale[] {
            Locale.US,
            Locale.GERMAN,
            Locale.JAPAN,
            Locale.ROOT,
    };
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:TestChronoField.java

示例9: testParse_GermanLocaleWithSeparators

@Test
public void testParse_GermanLocaleWithSeparators() throws Exception {
    PriceConverter converter = new PriceConverter(Locale.GERMAN);
    Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
    BigDecimal valueToStore = converter.parse("...,3");
    checkEquals("0.3", valueToStore);
    String valueToDisplay = converter.getValueToDisplay(valueToStore, true);
    Assert.assertEquals("0,30", valueToDisplay);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:9,代碼來源:PriceConverterTest.java

示例10: testParse_GermanLocaleWithSeparator

@Test
public void testParse_GermanLocaleWithSeparator() throws Exception {
    PriceConverter converter = new PriceConverter(Locale.GERMAN);
    Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
    BigDecimal valueToStore = converter.parse("50.000,14");
    checkEquals("50000.14", valueToStore);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:7,代碼來源:PriceConverterTest.java

示例11: testParse_MaximumIntegerDigitsDE_WithGroupingSeparators

@Test
public void testParse_MaximumIntegerDigitsDE_WithGroupingSeparators()
        throws Exception {
    PriceConverter converter = new PriceConverter(Locale.GERMAN);
    Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
    BigDecimal d = converter
            .parse("111111111111111111111.1.1111111111111111111111.111.111,001");
    assertEquals(new BigDecimal(
            "11111111111111111111111111111111111111111111111111.001"), d);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:PriceConverterTest.java

示例12: getLocale

private Locale getLocale(String localeName) {
    String language, country;
    int index;

    index = localeName.indexOf('_');
    if (index == -1) {
        //
        // Special case the builtin JDK languages
        //
        if (localeName.equals("de"))
            return Locale.GERMAN;
        if (localeName.equals("en"))
            return Locale.ENGLISH;
        if (localeName.equals("fr"))
            return Locale.FRENCH;
        if (localeName.equals("it"))
            return Locale.ITALIAN;
        if (localeName.equals("ja"))
            return Locale.JAPANESE;
        if (localeName.equals("ko"))
            return Locale.KOREAN;
        if (localeName.equals("zh"))
            return Locale.CHINESE;

        language = localeName;
        country = "";
    } else {
        if (localeName.equals("zh_CN"))
            return Locale.SIMPLIFIED_CHINESE;
        if (localeName.equals("zh_TW"))
            return Locale.TRADITIONAL_CHINESE;

        //
        // JDK also has constants for countries:  en_GB, en_US, en_CA,
        // fr_FR, fr_CA, de_DE, ja_JP, ko_KR.  We don't use those.
        //
        language = localeName.substring(0, index);
        country = localeName.substring(index + 1);
    }

    return new Locale(language, country);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:42,代碼來源:MessageCatalog.java

示例13: DbMessages_de

public DbMessages_de() throws IOException {
    super(Locale.GERMAN);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:3,代碼來源:DbMessages_de.java

示例14: DefaultMessages_de

public DefaultMessages_de() throws IOException {
    super(Locale.GERMAN);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:3,代碼來源:DefaultMessages_de.java

示例15: asTime_withLocaleGERMAN_returns_19_28

@Test
public void asTime_withLocaleGERMAN_returns_19_28() throws Exception {
    dateTimeFormatter = new DateTimeFormatter(Locale.GERMAN);
    assertEquals("19:28", dateTimeFormatter.asTime(of(19, 28, 15)));
}
 
開發者ID:tbressler,項目名稱:waterrower-workout,代碼行數:5,代碼來源:TestDateTimeFormatter.java


注:本文中的java.util.Locale.GERMAN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。