java.util.Collections.checkedSortedSet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(262)

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

Collections.checkedSortedSet介绍

[英]Returns a dynamically typesafe view of the specified sorted set. Trying to insert an element of the wrong type into this sorted set throws a ClassCastException. At creation time the types in s are not checked for correct type.
[中]返回指定排序集的动态类型安全视图。尝试将错误类型的元素插入此排序集中会引发ClassCastException。创建时,未检查s中的类型是否正确。

代码示例

代码示例来源:origin: google/guava

@Override
 public SortedSet<String> create(String[] elements) {
  SortedSet<String> innerSet = new TreeSet<>();
  Collections.addAll(innerSet, elements);
  return Collections.checkedSortedSet(innerSet, String.class);
 }
})

代码示例来源:origin: wildfly/wildfly

classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());

代码示例来源:origin: protostuff/protostuff

String.class); // no equals impl
checkedSet = Collections.checkedSet(es, Size.class);
checkedSortedSet = Collections.checkedSortedSet(ts, String.class);
checkedList = Collections.checkedList(ll, String.class);
checkedRandomAccessList = Collections.checkedList(newList("nine"),

代码示例来源:origin: org.apidesign.bck2brwsr/emul

public SortedSet<E> headSet(E toElement) {
  return checkedSortedSet(ss.headSet(toElement), type);
}
public SortedSet<E> tailSet(E fromElement) {

代码示例来源:origin: jtulach/bck2brwsr

public SortedSet<E> tailSet(E fromElement) {
    return checkedSortedSet(ss.tailSet(fromElement), type);
  }
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

public SortedSet<E> tailSet(E fromElement) {
    return checkedSortedSet(ss.tailSet(fromElement), type);
  }
}

代码示例来源:origin: jtulach/bck2brwsr

public SortedSet<E> headSet(E toElement) {
  return checkedSortedSet(ss.headSet(toElement), type);
}
public SortedSet<E> tailSet(E fromElement) {

代码示例来源:origin: com.google.guava/guava-testlib

@Override
 public SortedSet<String> create(String[] elements) {
  SortedSet<String> innerSet = new TreeSet<>();
  Collections.addAll(innerSet, elements);
  return Collections.checkedSortedSet(innerSet, String.class);
 }
})

代码示例来源:origin: org.apidesign.bck2brwsr/emul

public SortedSet<E> subSet(E fromElement, E toElement) {
  return checkedSortedSet(ss.subSet(fromElement,toElement), type);
}
public SortedSet<E> headSet(E toElement) {

代码示例来源:origin: jtulach/bck2brwsr

public SortedSet<E> subSet(E fromElement, E toElement) {
  return checkedSortedSet(ss.subSet(fromElement,toElement), type);
}
public SortedSet<E> headSet(E toElement) {

代码示例来源:origin: org.wildfly/wildfly-clustering-marshalling-jboss

classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());

相关文章

Collections类方法