java.util.concurrent.ConcurrentSkipListMap.compare()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(123)

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

ConcurrentSkipListMap.compare介绍

[英]Compares using comparator or natural ordering. Used when the ComparableUsingComparator approach doesn't apply.
[中]使用比较器或自然排序进行比较。当ComparableUsingComparator方法不适用时使用。

代码示例

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

private boolean tooHigh(K key) {
  if (hi != null) {
    int c = m.compare(key, hi);
    if (c > 0 || (c == 0 && !hiInclusive))
      return true;
  }
  return false;
}

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

private boolean tooLow(K key) {
  if (lo != null) {
    int c = m.compare(key, lo);
    if (c < 0 || (c == 0 && !loInclusive))
      return true;
  }
  return false;
}

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

/**
 * Returns true if node key is less than upper bound of range.
 */
private boolean isBeforeEnd(ConcurrentSkipListMap.Node<K,V> n) {
  if (n == null)
    return false;
  if (hi == null)
    return true;
  K k = n.key;
  if (k == null) // pass by markers and headers
    return true;
  int c = m.compare(k, hi);
  if (c > 0 || (c == 0 && !hiInclusive))
    return false;
  return true;
}

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

/**
 * Returns true if given key greater than or equal to least and
 * strictly less than fence, bypassing either test if least or
 * fence are null. Needed mainly in submap operations.
 */
boolean inHalfOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <  0));
}

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

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

SubMapIter() {
  for (;;) {
    next = isDescending ? hiNode() : loNode();
    if (next == null)
      break;
    Object x = next.value;
    if (x != null && x != next) {
      if (! inBounds(next.key))
        next = null;
      else
        nextValue = (V) x;
      break;
    }
  }
}

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

int c = m.compare(fromKey, lo);
if (c < 0 || (c == 0 && !loInclusive && fromInclusive))
  throw new IllegalArgumentException("key out of range");
int c = m.compare(toKey, hi);
if (c > 0 || (c == 0 && !hiInclusive && toInclusive))
  throw new IllegalArgumentException("key out of range");

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

private boolean tooHigh(K key) {
  if (hi != null) {
    int c = m.compare(key, hi);
    if (c > 0 || (c == 0 && !hiInclusive))
      return true;
  }
  return false;
}

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

private boolean tooHigh(K key) {
  if (hi != null) {
    int c = m.compare(key, hi);
    if (c > 0 || (c == 0 && !hiInclusive))
      return true;
  }
  return false;
}

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

private boolean tooLow(K key) {
  if (lo != null) {
    int c = m.compare(key, lo);
    if (c < 0 || (c == 0 && !loInclusive))
      return true;
  }
  return false;
}

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

private boolean tooLow(K key) {
  if (lo != null) {
    int c = m.compare(key, lo);
    if (c < 0 || (c == 0 && !loInclusive))
      return true;
  }
  return false;
}

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

private boolean tooLow(K key) {
  if (lo != null) {
    int c = m.compare(key, lo);
    if (c < 0 || (c == 0 && !loInclusive))
      return true;
  }
  return false;
}

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

private boolean tooHigh(K key) {
  if (hi != null) {
    int c = m.compare(key, hi);
    if (c > 0 || (c == 0 && !hiInclusive))
      return true;
  }
  return false;
}

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

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

/**
 * Returns true if given key greater than or equal to least and
 * strictly less than fence, bypassing either test if least or
 * fence are null. Needed mainly in submap operations.
 */
boolean inHalfOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <  0));
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Returns true if given key greater than or equal to least and less
 * or equal to fence. Needed mainly in submap operations.
 */
boolean inOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <= 0));
}

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

/**
 * Returns true if given key greater than or equal to least and
 * strictly less than fence, bypassing either test if least or
 * fence are null. Needed mainly in submap operations.
 */
boolean inHalfOpenRange(K key, K least, K fence) {
  if (key == null)
    throw new NullPointerException();
  return ((least == null || compare(key, least) >= 0) &&
      (fence == null || compare(key, fence) <  0));
}

相关文章

ConcurrentSkipListMap类方法