org.apache.sis.internal.util.Utilities.toUpperCase()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.sis.internal.util.Utilities.toUpperCase()方法的一些代码示例,展示了Utilities.toUpperCase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.toUpperCase()方法的具体详情如下:
包路径:org.apache.sis.internal.util.Utilities
类名称:Utilities
方法名:toUpperCase

Utilities.toUpperCase介绍

[英]Returns a string with the same content than the given string, but in upper case and containing only the filtered characters. If the given string already matches the criterion, then it is returned unchanged without creation of any temporary object.

This method is useful before call to an Enum.valueOf(String) method, for making the search a little bit more tolerant.

This method is not in public API because conversion to upper-cases should be locale-dependent.
[中]返回一个字符串,该字符串的内容与给定字符串相同,但为大写,并且只包含过滤后的字符。如果给定的字符串已经与条件匹配,那么它将原封不动地返回,而不创建任何临时对象。
在调用枚举之前,此方法很有用。valueOf(String)方法,使搜索更具包容性。
此方法不在公共API中,因为转换为大写字母应取决于语言环境。

代码示例

代码示例来源:origin: apache/sis

/**
   * Tests the {@link Utilities#toUpperCase(String, Characters.Filter)} method.
   */
  @Test
  public void testToUpperCase() {
    final String expected = "WGS84";
    assertSame  (expected, Utilities.toUpperCase(expected, Characters.Filter.LETTERS_AND_DIGITS));
    assertEquals(expected, Utilities.toUpperCase("WGS 84", Characters.Filter.LETTERS_AND_DIGITS));
    assertEquals(expected, Utilities.toUpperCase("wgs 84", Characters.Filter.LETTERS_AND_DIGITS));
  }
}

代码示例来源:origin: apache/sis

final PrimeMeridian meridian  = createPrimeMeridian(names, angularUnit);
final GeodeticDatum datum     = getDatumFactory().createGeodeticDatum(properties(name), ellipsoid, meridian);
name = Utilities.toUpperCase(name, Characters.Filter.LETTERS_AND_DIGITS);
lastName = datum.getName();
try {

代码示例来源:origin: org.apache.sis.storage/sis-earth-observation

datum = CommonCRS.valueOf(Utilities.toUpperCase(value, Characters.Filter.LETTERS_AND_DIGITS));
break;

代码示例来源:origin: apache/sis

datum = CommonCRS.valueOf(Utilities.toUpperCase(value, Characters.Filter.LETTERS_AND_DIGITS));
break;

相关文章