本文整理汇总了Java中java.lang.Character.UnicodeScript类的典型用法代码示例。如果您正苦于以下问题:Java UnicodeScript类的具体用法?Java UnicodeScript怎么用?Java UnicodeScript使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnicodeScript类属于java.lang.Character包,在下文中一共展示了UnicodeScript类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateRoundDown
import java.lang.Character.UnicodeScript; //导入依赖的package包/类
@Test
public void validateRoundDown() {
ProximityMap<UnicodeScript> prox = new ProximityMap<UnicodeScript>();
putAll(prox, Arrays.asList(javanese, greek, gothic, latin));
validate(prox, -43, javanese);
validate(prox, -42, javanese);
validate(prox, -41, javanese);
validate(prox, -33, javanese);
validate(prox, -32, javanese);
validate(prox, -31, greek);
validate(prox, -23, greek);
validate(prox, -22, greek);
validate(prox, -21, greek);
validate(prox, -12, greek);
validate(prox, -11, greek);
validate(prox, -10, latin);
validate(prox, -1, latin);
validate(prox, 0, latin);
validate(prox, 1, latin);
validate(prox, 10, latin);
validate(prox, 11, latin);
validate(prox, 12, gothic);
validate(prox, 21, gothic);
validate(prox, 22, gothic);
validate(prox, 23, gothic);
}
开发者ID:summabr,项目名称:sol,代码行数:29,代码来源:ProximityMapTest.java
示例2: validateRoundUp
import java.lang.Character.UnicodeScript; //导入依赖的package包/类
@Test
public void validateRoundUp() {
ProximityMap<UnicodeScript> prox = new ProximityMap<UnicodeScript>(Round.UP);
putAll(prox, Arrays.asList(javanese, greek, gothic, latin));
validate(prox, -43, javanese);
validate(prox, -42, javanese);
validate(prox, -41, javanese);
validate(prox, -33, javanese);
validate(prox, -32, greek);
validate(prox, -31, greek);
validate(prox, -23, greek);
validate(prox, -22, greek);
validate(prox, -21, greek);
validate(prox, -12, greek);
validate(prox, -11, latin);
validate(prox, -10, latin);
validate(prox, -1, latin);
validate(prox, 0, latin);
validate(prox, 1, latin);
validate(prox, 10, latin);
validate(prox, 11, gothic);
validate(prox, 12, gothic);
validate(prox, 21, gothic);
validate(prox, 22, gothic);
validate(prox, 23, gothic);
}
开发者ID:summabr,项目名称:sol,代码行数:29,代码来源:ProximityMapTest.java
示例3: validateSingle
import java.lang.Character.UnicodeScript; //导入依赖的package包/类
@Test
public void validateSingle() {
ProximityMap<UnicodeScript> prox = new ProximityMap<UnicodeScript>();
putAll(prox, Arrays.asList(javanese));
validate(prox, -1000, javanese);
validate(prox, -43, javanese);
validate(prox, -42, javanese);
validate(prox, 1000, javanese);
}
开发者ID:summabr,项目名称:sol,代码行数:12,代码来源:ProximityMapTest.java
示例4: validateEmpty
import java.lang.Character.UnicodeScript; //导入依赖的package包/类
@Test
public void validateEmpty() {
ProximityMap<UnicodeScript> prox = new ProximityMap<UnicodeScript>();
validate(prox, -1000, null);
validate(prox, 1000, null);
}
开发者ID:summabr,项目名称:sol,代码行数:8,代码来源:ProximityMapTest.java
示例5: validate
import java.lang.Character.UnicodeScript; //导入依赖的package包/类
private static void validate(ProximityMap<UnicodeScript> prox, int pos, Pair<BigDecimal, UnicodeScript> expected) {
BigDecimal key = new BigDecimal(pos);
if (expected == null) {
assertNull(prox.closestEntry(key));
assertNull(prox.closestKey(key));
assertNull(prox.closestValue(key));
} else {
assertEquals(expected.getX(), prox.closestEntry(key).getKey());
assertEquals(expected.getX(), prox.closestKey(key));
assertEquals(expected.getY(), prox.closestEntry(key).getValue());
assertEquals(expected.getY(), prox.closestValue(key));
}
}
开发者ID:summabr,项目名称:sol,代码行数:14,代码来源:ProximityMapTest.java
注:本文中的java.lang.Character.UnicodeScript类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论