本文整理了Java中java.util.TreeMap.navigableKeySet()
方法的一些代码示例,展示了TreeMap.navigableKeySet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TreeMap.navigableKeySet()
方法的具体详情如下:
包路径:java.util.TreeMap
类名称:TreeMap
方法名:navigableKeySet
暂无
代码示例来源:origin: prestodb/presto
ImmutableList.Builder<Field> fieldsBuilder = ImmutableList.builder();
int size = field.split("\\.").length;
Iterator<String> iterator = fieldsMap.navigableKeySet().iterator();
while (iterator.hasNext()) {
String name = iterator.next();
代码示例来源:origin: voldemort/voldemort
boolean v2Bigger = false;
SortedSet<Short> v1Nodes = v1.getVersionMap().navigableKeySet();
SortedSet<Short> v2Nodes = v2.getVersionMap().navigableKeySet();
代码示例来源:origin: voldemort/voldemort
public int toBytes(byte[] buf, int offset) {
// write the number of versions
ByteUtils.writeShort(buf, (short) versionMap.size(), offset);
offset += ByteUtils.SIZE_OF_SHORT;
// write the size of each version in bytes
byte versionSize = ByteUtils.numberOfBytesRequired(getMaxVersion());
buf[offset] = versionSize;
offset++;
int clockEntrySize = ByteUtils.SIZE_OF_SHORT + versionSize;
SortedSet<Short> nodeIds = versionMap.navigableKeySet();
for(Short nodeId: nodeIds) {
Long version = versionMap.get(nodeId);
ByteUtils.writeShort(buf, nodeId, offset);
ByteUtils.writeBytes(buf, version, offset + ByteUtils.SIZE_OF_SHORT, versionSize);
offset += clockEntrySize;
}
ByteUtils.writeLong(buf, this.timestamp, offset);
return sizeInBytes();
}
代码示例来源:origin: apache/hive
dbName = dbName.toLowerCase();
catName = normalizeSpace(catName).toLowerCase();
partitions.navigableKeySet();
for (Object[] fields : sqlResult) {
代码示例来源:origin: org.codehaus.mojo/jaxb2-maven-plugin
/**
* {@inheritDoc}
*/
@Override
public SortedSet<String> getPaths() {
return Collections.unmodifiableSortedSet(keyMap.navigableKeySet());
}
代码示例来源:origin: mojohaus/jaxb2-maven-plugin
/**
* {@inheritDoc}
*/
@Override
public SortedSet<String> getPaths() {
return Collections.unmodifiableSortedSet(keyMap.navigableKeySet());
}
代码示例来源: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());
}
代码示例来源:origin: MegaMek/mekhq
/** @return events for this year. Never returns <i>null</i>. */
public List<PlanetaryEvent> getEvents(int year) {
if( null == events ) {
return Collections.<PlanetaryEvent>emptyList();
}
List<PlanetaryEvent> result = new ArrayList<PlanetaryEvent>();
for( DateTime date : events.navigableKeySet() ) {
if( date.getYear() > year ) {
break;
}
if( date.getYear() == year ) {
result.add(events.get(date));
}
}
return result;
}
代码示例来源: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.apache.kafka/kafka-streams
synchronized Iterator<Bytes> allKeys() {
return keySetIterator(cache.navigableKeySet());
}
代码示例来源:origin: MegaMek/mekhq
public FactionListModel(DateTime date) {
for(Faction faction : Faction.getFactions()) {
factionMap.put(faction.getFullName(date.getYear()), faction);
}
names = new ArrayList<>(factionMap.navigableKeySet());
}
代码示例来源:origin: MegaMek/mekhq
protected <T> T getEventData(DateTime when, T defaultValue, EventGetter<T> getter) {
if( null == when || null == events || null == getter ) {
return defaultValue;
}
T result = defaultValue;
for( DateTime date : events.navigableKeySet() ) {
if( date.isAfter(when) ) {
break;
}
result = Utilities.nonNull(getter.get(events.get(date)), result);
}
return result;
}
代码示例来源:origin: org.apache.kafka/kafka-streams
@Override
public KeyValueIterator<K, V> all() {
final TreeMap<K, V> treeMap = toTreeMap();
return new MemoryNavigableLRUCache.CacheIterator<>(treeMap.navigableKeySet().iterator(), treeMap);
}
代码示例来源:origin: org.apache.kafka/kafka-streams
synchronized Iterator<Bytes> keyRange(final Bytes from, final Bytes to) {
return keySetIterator(cache.navigableKeySet().subSet(from, true, to, true));
}
代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics
ActivityStackGraph(TreeMap<Long, Map<String, Set<UUID>>> activityData, String[] colors, Formatter<Long> dayFormatter) {
super(getLabels(activityData.navigableKeySet(), dayFormatter), getDataSets(activityData, colors));
}
代码示例来源:origin: io.permazen/permazen-coreapi
/**
* Get all of the names of {@link SchemaField}s in the given {@link SchemaObjectType}.
*
* @param type schema object
* @return unmodifiable set of {@link SchemaField} names in {@code type}
* @throws IllegalArgumentException if {@code type} is not indexed by this instance
*/
public NavigableSet<String> getSchemaFieldNames(SchemaObjectType type) {
Preconditions.checkArgument(type != null, "null type");
final TreeMap<String, SchemaField> fieldMap = this.typeFieldMap.get(type.getStorageId());
if (fieldMap == null)
throw new IllegalArgumentException("unknown type `" + type.getName() + "' with storage ID " + type.getStorageId());
return Collections.unmodifiableNavigableSet(fieldMap.navigableKeySet());
}
代码示例来源:origin: org.jsimpledb/jsimpledb-coreapi
/**
* Get all of the names of {@link SchemaField}s in the given {@link SchemaObjectType}.
*
* @param type schema object
* @return unmodifiable set of {@link SchemaField} names in {@code type}
* @throws IllegalArgumentException if {@code type} is not indexed by this instance
*/
public NavigableSet<String> getSchemaFieldNames(SchemaObjectType type) {
Preconditions.checkArgument(type != null, "null type");
final TreeMap<String, SchemaField> fieldMap = this.typeFieldMap.get(type.getStorageId());
if (fieldMap == null)
throw new IllegalArgumentException("unknown type `" + type.getName() + "' with storage ID " + type.getStorageId());
return Collections.unmodifiableNavigableSet(fieldMap.navigableKeySet());
}
代码示例来源:origin: io.permazen/permazen-coreapi
/**
* Get all of the names of {@link SchemaCompositeIndex}s in the given {@link SchemaObjectType}.
*
* @param type schema object
* @return unmodifiable set of {@link SchemaCompositeIndex} names in {@code type}
* @throws IllegalArgumentException if {@code type} is not indexed by this instance
*/
public NavigableSet<String> getSchemaCompositeIndexNames(SchemaObjectType type) {
Preconditions.checkArgument(type != null, "null type");
final TreeMap<String, SchemaCompositeIndex> indexMap = this.typeCompositeIndexMap.get(type.getStorageId());
if (indexMap == null)
throw new IllegalArgumentException("unknown type `" + type.getName() + "' with storage ID " + type.getStorageId());
return Collections.unmodifiableNavigableSet(indexMap.navigableKeySet());
}
}
代码示例来源:origin: org.jsimpledb/jsimpledb-coreapi
/**
* Get all of the names of {@link SchemaCompositeIndex}s in the given {@link SchemaObjectType}.
*
* @param type schema object
* @return unmodifiable set of {@link SchemaCompositeIndex} names in {@code type}
* @throws IllegalArgumentException if {@code type} is not indexed by this instance
*/
public NavigableSet<String> getSchemaCompositeIndexNames(SchemaObjectType type) {
Preconditions.checkArgument(type != null, "null type");
final TreeMap<String, SchemaCompositeIndex> indexMap = this.typeCompositeIndexMap.get(type.getStorageId());
if (indexMap == null)
throw new IllegalArgumentException("unknown type `" + type.getName() + "' with storage ID " + type.getStorageId());
return Collections.unmodifiableNavigableSet(indexMap.navigableKeySet());
}
}
代码示例来源:origin: org.apache.kafka/kafka-streams
@Override
public KeyValueIterator<K, V> range(final K from, final K to) {
final TreeMap<K, V> treeMap = toTreeMap();
return new DelegatingPeekingKeyValueIterator<>(name(), new MemoryNavigableLRUCache.CacheIterator<>(treeMap.navigableKeySet().subSet(from, true, to, true).iterator(), treeMap));
}
内容来源于网络,如有侵权,请联系作者删除!