本文整理了Java中java.util.Collections.emptyNavigableSet()
方法的一些代码示例,展示了Collections.emptyNavigableSet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collections.emptyNavigableSet()
方法的具体详情如下:
包路径:java.util.Collections
类名称:Collections
方法名:emptyNavigableSet
暂无
代码示例来源:origin: google/guava
@Override
public NavigableSet<String> create(String[] elements) {
return Collections.emptyNavigableSet();
}
})
代码示例来源:origin: immutables/immutables
@Value.Default
@Value.ReverseOrder
default NavigableSet<Integer> navs() {
return Collections.emptyNavigableSet();
}
}
代码示例来源:origin: wildfly/wildfly
classes.add(Collections.checkedMap(Collections.emptyMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedNavigableMap(Collections.emptyNavigableMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedNavigableSet(Collections.emptyNavigableSet(), Void.class).getClass());
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass());
classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.synchronizedMap(Collections.emptyMap()).getClass());
classes.add(Collections.synchronizedNavigableMap(Collections.emptyNavigableMap()).getClass());
classes.add(Collections.synchronizedNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.synchronizedSet(Collections.emptySet()).getClass());
classes.add(Collections.synchronizedSortedMap(Collections.emptySortedMap()).getClass());
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.emptyMap()));
assertTrue(immutability.test(Collections.emptyNavigableMap()));
assertTrue(immutability.test(Collections.emptyNavigableSet()));
assertTrue(immutability.test(Collections.emptySet()));
assertTrue(immutability.test(Collections.emptySortedMap()));
代码示例来源:origin: com.google.guava/guava-testlib
@Override
public NavigableSet<String> create(String[] elements) {
return Collections.emptyNavigableSet();
}
})
代码示例来源:origin: chungkwong/MathOCR
public NavigableSet<Pair<Integer,Double>> getErrata(int codePoint){
return erratas.getOrDefault(codePoint,Collections.emptyNavigableSet());
}
public static ErrataList generate(Iterator<Pair<Integer,ConnectedComponent>> iterator,CharacterRecognizer recognizer,long support,double threhold){
代码示例来源:origin: org.apache.sshd/sshd-core
@Override
public NavigableSet<Integer> getStartedRemotePortForwards() {
synchronized (remoteToLocal) {
if (remoteToLocal.isEmpty()) {
return Collections.emptyNavigableSet();
}
return GenericUtils.asSortedSet(remoteToLocal.keySet());
}
}
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
@Override
public NavigableSet<Integer> getStartedLocalPortForwards() {
synchronized (localToRemote) {
if (localToRemote.isEmpty()) {
return Collections.emptyNavigableSet();
}
return GenericUtils.asSortedSet(localToRemote.keySet());
}
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
@Override
public NavigableSet<Integer> getStartedRemotePortForwards() {
synchronized (remoteToLocal) {
if (remoteToLocal.isEmpty()) {
return Collections.emptyNavigableSet();
}
return GenericUtils.asSortedSet(remoteToLocal.keySet());
}
}
}
代码示例来源:origin: org.apache.sshd/sshd-core
@Override
public NavigableSet<Integer> getStartedLocalPortForwards() {
synchronized (localToRemote) {
if (localToRemote.isEmpty()) {
return Collections.emptyNavigableSet();
}
return GenericUtils.asSortedSet(localToRemote.keySet());
}
}
代码示例来源:origin: org.apache.sshd/sshd-core
@Override
public NavigableSet<Integer> getStartedRemotePortForwards() {
ForwardingFilter filter = getForwardingFilter();
return (filter == null) ? Collections.emptyNavigableSet() : filter.getStartedRemotePortForwards();
}
代码示例来源:origin: org.apache.sshd/sshd-core
@Override
public NavigableSet<Integer> getStartedLocalPortForwards() {
ForwardingFilter filter = getForwardingFilter();
return (filter == null) ? Collections.emptyNavigableSet() : filter.getStartedLocalPortForwards();
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
@Override
public NavigableSet<Integer> getStartedRemotePortForwards() {
ForwardingFilter filter = getForwardingFilter();
return (filter == null) ? Collections.emptyNavigableSet() : filter.getStartedRemotePortForwards();
}
代码示例来源:origin: io.permazen/permazen-coreapi
/**
* Build a data structure that to optimize checking whether a field in an object type is being monitored.
*/
private synchronized NavigableSet<Long> buildHasFieldMonitorCache() {
if (this.monitorMap == null)
return Collections.emptyNavigableSet();
final TreeSet<Long> set = new TreeSet<>();
for (Schema otherSchema : this.schemas.versions.values()) {
for (ObjType objType : otherSchema.objTypeMap.values()) {
final int objTypeStorageId = objType.storageId;
for (Field<?> field : objType.fieldsAndSubFields) {
final int fieldStorageId = field.storageId;
final Set<FieldMonitor> monitors = this.getMonitorsForField(fieldStorageId);
if (monitors != null && monitors.stream().anyMatch(new MonitoredPredicate(objTypeStorageId, fieldStorageId)))
set.add(this.buildHasFieldMonitorCacheKey(objTypeStorageId, fieldStorageId));
}
}
}
return set;
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
@Override
public NavigableSet<Integer> getStartedLocalPortForwards() {
ForwardingFilter filter = getForwardingFilter();
return (filter == null) ? Collections.emptyNavigableSet() : filter.getStartedLocalPortForwards();
}
代码示例来源:origin: hypercube1024/firefly
public HTTP2ServerBuilder httpServer(SimpleHTTPServerConfiguration serverConfiguration,
HTTPBodyConfiguration httpBodyConfiguration) {
AbstractErrorResponseHandler handler = DefaultErrorResponseHandlerLoader.getInstance().getHandler();
server = new SimpleHTTPServer(serverConfiguration);
server.badMessage((status, reason, request) -> {
RoutingContext ctx = new RoutingContextImpl(request, Collections.emptyNavigableSet());
handler.render(ctx, status, new BadMessageException(reason));
});
routerManager = RouterManager.create(httpBodyConfiguration);
return this;
}
代码示例来源:origin: com.fireflysource/firefly
public HTTP2ServerBuilder httpServer(SimpleHTTPServerConfiguration serverConfiguration,
HTTPBodyConfiguration httpBodyConfiguration) {
AbstractErrorResponseHandler handler = DefaultErrorResponseHandlerLoader.getInstance().getHandler();
server = new SimpleHTTPServer(serverConfiguration);
server.badMessage((status, reason, request) -> {
RoutingContext ctx = new RoutingContextImpl(request, Collections.emptyNavigableSet());
handler.render(ctx, status, new BadMessageException(reason));
});
routerManager = RouterManager.create(httpBodyConfiguration);
return this;
}
代码示例来源:origin: vmware/xenon
@Test
public void readPost111() throws IOException {
String prefix = "post-1.1.1-";
assertCollectionEqualAndUsable(Collections.emptyList(), readFileAndDeserialize(prefix + "emptyList"));
assertCollectionEqualAndUsable(Arrays.asList("test"), readFileAndDeserialize(prefix + "asList"));
assertCollectionEqualAndUsable(Collections.emptyMap(), readFileAndDeserialize(prefix + "emptyMap"));
assertCollectionEqualAndUsable(Collections.emptyNavigableMap(),
readFileAndDeserialize(prefix + "emptyNavigableMap"));
assertCollectionEqualAndUsable(Collections.emptySortedMap(), readFileAndDeserialize(prefix + "emptySortedMap"));
assertCollectionEqualAndUsable(Collections.emptySet(), readFileAndDeserialize(prefix + "emptySet"));
assertCollectionEqualAndUsable(Collections.emptyNavigableSet(),
readFileAndDeserialize(prefix + "emptyNavigableSet"));
assertCollectionEqualAndUsable(Collections.emptySortedSet(), readFileAndDeserialize(prefix + "emptySortedSet"));
assertCollectionEqualAndUsable(Collections.singleton("test"), readFileAndDeserialize(prefix + "singletonSet"));
assertCollectionEqualAndUsable(Collections.singletonList("test"),
readFileAndDeserialize(prefix + "singletonList"));
assertCollectionEqualAndUsable(Collections.singletonMap("k", "v"),
readFileAndDeserialize(prefix + "singletonMap"));
}
代码示例来源:origin: com.vmware.xenon/xenon-common
@Test
public void testEmptyCollectionSerialization() {
Object target;
target = Collections.emptyList();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyNavigableMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyNavigableSet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySortedMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySortedSet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
}
代码示例来源:origin: vmware/xenon
@Test
public void testEmptyCollectionClone() {
Object target;
target = Collections.emptyList();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyNavigableMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyNavigableSet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySortedMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySortedSet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
}
内容来源于网络,如有侵权,请联系作者删除!