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

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

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

Collections.unmodifiableNavigableMap介绍

暂无

代码示例

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

@Override
 protected NavigableMap<String, String> create(Entry<String, String>[] entries) {
  return Collections.unmodifiableNavigableMap(populate(new TreeMap<>(), entries));
 }
})

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

@Override
@Nullable
public NavigableMap<ValueTuple, ? extends LongDiffSets> getSortedIndexUpdates( SchemaDescriptor descriptor )
{
  if ( indexUpdates == null )
  {
    return null;
  }
  Map<ValueTuple, MutableLongDiffSets> updates = indexUpdates.get( descriptor );
  if ( updates == null )
  {
    return null;
  }
  TreeMap<ValueTuple, MutableLongDiffSets> sortedUpdates;
  if ( updates instanceof TreeMap )
  {
    sortedUpdates = (TreeMap<ValueTuple, MutableLongDiffSets>) updates;
  }
  else
  {
    sortedUpdates = new TreeMap<>( ValueTuple.COMPARATOR );
    sortedUpdates.putAll( updates );
    indexUpdates.put( descriptor, sortedUpdates );
  }
  return Collections.unmodifiableNavigableMap( sortedUpdates );
}

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

classes.add(Collections.unmodifiableList(nonRandomAccessList).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());

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

assertTrue(immutability.test(Collections.unmodifiableList(Arrays.asList("1", "2"))));
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"))));

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

this.supervisorClasspaths = Collections.unmodifiableNavigableMap(

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

GetAutoFollowPatternResponse(NavigableMap<String, Pattern> patterns) {
  this.patterns = Collections.unmodifiableNavigableMap(patterns);
}

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

IndicesFollowStats(NavigableMap<String, List<ShardFollowStats>> shardFollowStats) {
  this.shardFollowStats = Collections.unmodifiableNavigableMap(shardFollowStats);
}

代码示例来源:origin: axkr/symja_android_library

UnitImpl(NavigableMap<String, IExpr> navigableMap) {
  this.navigableMap = Collections.unmodifiableNavigableMap(navigableMap);
}

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

@Override
 protected NavigableMap<String, String> create(Entry<String, String>[] entries) {
  return Collections.unmodifiableNavigableMap(populate(new TreeMap<>(), entries));
 }
})

代码示例来源:origin: org.ogema.widgets/ogema-js-bundle

@Override
public NavigableMap<Long, ReceivedMessage> getMessages(MessageStatus status) {
  switch(status) {
  case CREATED:
    return Collections.unmodifiableNavigableMap(messages.unreadMessages);
  case READ:
    return Collections.unmodifiableNavigableMap(messages.readMessages);
  case DELETED:
    return Collections.unmodifiableNavigableMap(messages.deletedMessages);
  default: 
    return Collections.emptyNavigableMap();
  }
}

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

/**
 * Creates a new instance of the StreamSegments class.
 *
 * @param segments Segments of a stream, keyed by the largest key in their key range.
 *                 i.e. If there are two segments split evenly, the first should have a value of 0.5 and the second 1.0.
 * @param delegationToken Delegation token to access the segments in the segmentstore
 */
public StreamSegments(NavigableMap<Double, SegmentWithRange> segments, String delegationToken) {
  this.segments = Collections.unmodifiableNavigableMap(segments);
  this.delegationToken = delegationToken;
  verifySegments();
}

代码示例来源:origin: org.apache.sshd/sshd-osgi

public NavigableMap<K, V> immutable() {
  return Collections.unmodifiableNavigableMap(build());
}

代码示例来源:origin: org.ogema.widgets/ogema-js-bundle

private NavigableMap<Long, ReceivedMessage> getMessages(long tm, MessageStatus status) {
  switch(status) {
  case SENT:
    return Collections.unmodifiableNavigableMap(messages.unreadMessages.tailMap(tm));
  case READ:
    return Collections.unmodifiableNavigableMap(messages.readMessages.tailMap(tm));
  case DELETED:
    return Collections.unmodifiableNavigableMap(messages.deletedMessages.tailMap(tm));
  default: 
    return Collections.emptyNavigableMap();
  }
}

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

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  this.schemaFields = Collections.unmodifiableNavigableMap(this.schemaFields);
  for (SchemaField schemaField : this.schemaFields.values())
    schemaField.lockDown();
  this.schemaCompositeIndexes = Collections.unmodifiableNavigableMap(this.schemaCompositeIndexes);
  for (SchemaCompositeIndex schemaCompositeIndex : this.schemaCompositeIndexes.values())
    schemaCompositeIndex.lockDown();
}

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

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  this.schemaFields = Collections.unmodifiableNavigableMap(this.schemaFields);
  for (SchemaField schemaField : this.schemaFields.values())
    schemaField.lockDown();
  this.schemaCompositeIndexes = Collections.unmodifiableNavigableMap(this.schemaCompositeIndexes);
  for (SchemaCompositeIndex schemaCompositeIndex : this.schemaCompositeIndexes.values())
    schemaCompositeIndex.lockDown();
}

代码示例来源:origin: org.apache.bookkeeper/stream-storage-java-client-base

public static HashStreamRanges ofHash(RangeKeyType keyType,
                   NavigableMap<Long, RangeProperties> ranges) {
  checkArgument(RangeKeyType.HASH == keyType,
    "Only hash routing is supported now. %s is not supported.", keyType);
  NavigableMap<Long, RangeProperties> readOnlyRanges = Collections.unmodifiableNavigableMap(ranges);
  long maxRangeId = 0L;
  for (RangeProperties props : ranges.values()) {
    maxRangeId = Math.max(maxRangeId, props.getRangeId());
  }
  return new HashStreamRanges(readOnlyRanges, maxRangeId);
}

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

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  this.schemaObjectTypes = Collections.unmodifiableNavigableMap(this.schemaObjectTypes);
  for (SchemaObjectType schemaObjectType : this.schemaObjectTypes.values())
    schemaObjectType.lockDown();
}

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

@Override
void lockDownRecurse() {
  super.lockDownRecurse();
  this.schemaObjectTypes = Collections.unmodifiableNavigableMap(this.schemaObjectTypes);
  for (SchemaObjectType schemaObjectType : this.schemaObjectTypes.values())
    schemaObjectType.lockDown();
}

代码示例来源:origin: MartinHaeusler/chronos

private NavigableMap<Long, byte[]> getMapForReading(final MapDBTransaction tx) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  String mapName = this.getBranchName() + MAP_SUFFIX;
  if (tx.exists(mapName)) {
    return Collections.unmodifiableNavigableMap(tx.treeMap(mapName, Serializer.LONG, Serializer.BYTE_ARRAY));
  } else {
    return Collections.emptyNavigableMap();
  }
}

代码示例来源:origin: org.apache.calcite/calcite-core

/** Returns a map containing all the entries in the map that match the given
 * name. If case-sensitive, that map will have 0 or 1 elements; if
 * case-insensitive, it may have 0 or more. */
public NavigableMap<String, V> range(String name, boolean caseSensitive) {
 Object floorKey;
 Object ceilingKey;
 if (caseSensitive) {
  floorKey = name;
  ceilingKey = name;
 } else {
  floorKey = COMPARATOR.floorKey(name);
  ceilingKey = COMPARATOR.ceilingKey(name);
 }
 NavigableMap subMap = ((NavigableMap) map).subMap(floorKey, true, ceilingKey, true);
 return Collections.unmodifiableNavigableMap((NavigableMap<String, V>) subMap);
}

相关文章

Collections类方法