java.util.TreeMap.find()方法的使用及代码示例

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

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

TreeMap.find介绍

[英]Returns the node at or adjacent to the given key, creating it if requested.
[中]返回给定键处或其附近的节点,并在请求时创建该节点。

代码示例

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

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

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

@SuppressWarnings("unchecked") // this method throws ClassCastExceptions!
Node<K, V> findByObject(Object key) {
  return find((K) key, EQUAL);
}

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

public K higherKey(K key) {
  Entry<K, V> entry = find(key, HIGHER);
  return entry != null ? entry.getKey() : null;
}

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

public K lowerKey(K key) {
  Entry<K, V> entry = find(key, LOWER);
  return entry != null ? entry.getKey() : null;
}

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

public K floorKey(K key) {
  Entry<K, V> entry = find(key, FLOOR);
  return entry != null ? entry.getKey() : null;
}

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

public K ceilingKey(K key) {
  Entry<K, V> entry = find(key, CEILING);
  return entry != null ? entry.getKey() : null;
}

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

public Entry<K, V> floorEntry(K key) {
  return immutableCopy(find(key, FLOOR));
}

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

public Entry<K, V> ceilingEntry(K key) {
  return immutableCopy(find(key, CEILING));
}

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

public Entry<K, V> higherEntry(K key) {
  return immutableCopy(find(key, HIGHER));
}

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

public Entry<K, V> lowerEntry(K key) {
  return immutableCopy(find(key, LOWER));
}

代码示例来源:origin: MobiVM/robovm

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: com.bugvm/bugvm-rt

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: com.jtransc/jtransc-rt

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: ibinti/bugvm

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: MobiVM/robovm

@SuppressWarnings("unchecked") // this method throws ClassCastExceptions!
Node<K, V> findByObject(Object key) {
  return find((K) key, EQUAL);
}

代码示例来源:origin: com.gluonhq/robovm-rt

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

V putInternal(K key, V value) {
  Node<K, V> created = find(key, Relation.CREATE);
  V result = created.value;
  created.value = value;
  return result;
}

代码示例来源:origin: MobiVM/robovm

public K lowerKey(K key) {
  Entry<K, V> entry = find(key, LOWER);
  return entry != null ? entry.getKey() : null;
}

代码示例来源:origin: MobiVM/robovm

public K floorKey(K key) {
  Entry<K, V> entry = find(key, FLOOR);
  return entry != null ? entry.getKey() : null;
}

代码示例来源:origin: ibinti/bugvm

public K floorKey(K key) {
  Entry<K, V> entry = find(key, FLOOR);
  return entry != null ? entry.getKey() : null;
}

相关文章