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

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

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

Collections.unmodifiableNavigableSet介绍

暂无

代码示例

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

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

代码示例来源:origin: linkedin/cruise-control

/**
 * Get the sorted replicas in the ascending order of their priority and score.
 * This method initialize the sorted replicas if it hasn't been initialized.
 *
 * @return the sorted replicas in the ascending order of their priority and score.
 */
public NavigableSet<ReplicaWrapper> sortedReplicas() {
 ensureInitialize();
 return Collections.unmodifiableNavigableSet(_sortedReplicas);
}

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

classes.add(Collections.unmodifiableMap(Collections.emptyMap()).getClass());
classes.add(Collections.unmodifiableNavigableMap(Collections.emptyNavigableMap()).getClass());
classes.add(Collections.unmodifiableNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.unmodifiableSet(Collections.emptySet()).getClass());
classes.add(Collections.unmodifiableSortedMap(Collections.emptySortedMap()).getClass());

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

assertTrue(immutability.test(Collections.unmodifiableMap(Collections.singletonMap("1", "2"))));
assertTrue(immutability.test(Collections.unmodifiableNavigableMap(new TreeMap<>(Collections.singletonMap("1", "2")))));
assertTrue(immutability.test(Collections.unmodifiableNavigableSet(new TreeSet<>(Collections.singleton("1")))));
assertTrue(immutability.test(Collections.unmodifiableSet(Collections.singleton("1"))));
assertTrue(immutability.test(Collections.unmodifiableSortedMap(new TreeMap<>(Collections.singletonMap("1", "2")))));

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

/**
 * Creates a new message set.
 *
 * @param messages The messages to be contained in this set.
 */
public MessageSetImpl(NavigableSet<Message> messages) {
  this.messages = Collections.unmodifiableNavigableSet(messages);
}

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

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

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
  TreeSet<T> set = reverse
    ? new TreeSet<T>(Collections.reverseOrder())
    : new TreeSet<T>();
  set.addAll(list);
  return Collections.unmodifiableNavigableSet(set);
 }
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.syndesis.common/common-model

private static <T extends Comparable<T>> NavigableSet<T> createUnmodifiableSortedSet(boolean reverse, List<T> list) {
 TreeSet<T> set = reverse
   ? new TreeSet<T>(Collections.reverseOrder())
   : new TreeSet<T>();
 set.addAll(list);
 return Collections.unmodifiableNavigableSet(set);
}

代码示例来源:origin: io.permazen/permazen-coreapi

/**
 * Get the names of all {@link SchemaObjectType}s.
 *
 * @return unmodifiable set of {@link SchemaObjectType} names
 */
public NavigableSet<String> getSchemaObjectTypeNames() {
  return Collections.unmodifiableNavigableSet(this.typeMap.navigableKeySet());
}

代码示例来源:origin: org.jsimpledb/jsimpledb-coreapi

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  if (this.objectTypes != null)
    this.objectTypes = Collections.unmodifiableNavigableSet(this.objectTypes);
}

代码示例来源:origin: io.permazen/permazen-coreapi

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  if (this.objectTypes != null)
    this.objectTypes = Collections.unmodifiableNavigableSet(this.objectTypes);
}

代码示例来源:origin: org.jsimpledb/jsimpledb-coreapi

/**
 * Get the names of all {@link SchemaObjectType}s.
 *
 * @return unmodifiable set of {@link SchemaObjectType} names
 */
public NavigableSet<String> getSchemaObjectTypeNames() {
  return Collections.unmodifiableNavigableSet(this.typeMap.navigableKeySet());
}

相关文章

Collections类方法