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

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

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

TreeMap.higherEntry介绍

暂无

代码示例

代码示例来源:origin: linkedin/parseq

long getStallsSince(long lastUpdate) {
 long stall = 0;
 Entry<Long, Long> entry = _stalls.ceilingEntry(lastUpdate);
 while(entry != null) {
  stall += entry.getValue();
  entry = _stalls.higherEntry(entry.getKey());
 }
 return stall;
}

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

private void scheduleNextPlaybackEvent() {
 if (!isReallyPlaying()) {
  return;
 }
 final int currentPosition = getCurrentPositionRaw();
 MediaInfo info = getMediaInfo();
 Entry<Integer, RunList> event = info.events.higherEntry(currentPosition);
 if (event == null) {
  // This means we've "seeked" past the end. Get the last
  // event (which should be the completion event) and
  // invoke that, setting the position to the duration.
  postEvent(completionCallback);
 } else {
  final int runListOffset = event.getKey();
  nextPlaybackEvent = event.getValue();
  postEventDelayed(nextPlaybackEvent, runListOffset - currentPosition);
 }
}

代码示例来源:origin: apache/incubator-gobblin

Map.Entry<Character, UrlTrieNode> sibling = parent.children.higherEntry(_toReturn.getValue());
if (sibling == null) {
 _currentNode = null;

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

lottery.higherEntry(random.nextInt(offset)).getValue();
return winner;

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Gets the size of the slab cache a ByteBuffer of this size would be
 * allocated to.
 *
 * @param size Size of the ByteBuffer we are checking.
 *
 * @return the Slab that the above bytebuffer would be allocated towards. If
 *         object is too large, returns null.
 */
Entry<Integer, SingleSizeCache> getHigherBlock(int size) {
 return sizer.higherEntry(size - 1);
}

代码示例来源:origin: jordw/heftydb

protected Map.Entry nextEntry(Key key) {
  return tuples.higherEntry(key);
}

代码示例来源:origin: y20k/transistor

public MediaMetadataCompat getStationAfter(String stationId) {
  Map.Entry<String, MediaMetadataCompat> entry = mStationListById.higherEntry(stationId);
  if (entry != null) {
    return entry.getValue();
  }
  return null;
}

代码示例来源:origin: MSGFPlus/msgfplus

public String getAnnotation(long position) {
  Entry<Integer, String> entry = annotations.higherEntry((int) position);
  if (entry != null)
    return entry.getValue();
  else
    return null;
}

代码示例来源:origin: MSGFPlus/msgfplus

public String getAnnotation(long position) {
  Entry<Integer, String> entry = annotations.higherEntry((int) position);
  if (entry != null)
    return entry.getValue();
  else
    return null;
}

代码示例来源:origin: SonarSource/sonarlint-core

public void registerAnalysis(int analysisTimeMs) {
 Entry<Integer, String> entry = INTERVALS.higherEntry(analysisTimeMs);
 if (entry != null) {
  frequencies.compute(entry.getValue(), (k, v) -> v != null ? (v + 1) : 1);
  analysisCount++;
 }
}

代码示例来源:origin: org.integratedmodelling/klab-engine

@Override
public ITemporalExtent getExtent(int stateIndex) {
  Entry<ITimeInstant, WrappedObject> result = collection.firstEntry();
  ITimeInstant currentPosition = result.getKey();
  for (int i = 0; i < stateIndex && result != null; i++) {
    result = collection.higherEntry(currentPosition);
    currentPosition = result.getKey();
  }
  return result == null ? null : result.getValue().timePeriod;
}

代码示例来源:origin: com.linkedin.pegasus/d2

@Override
public T get(int unused)
{
 if (_cumulativePointsMap.isEmpty())
 {
  LOG.warn("Calling get on an empty ring, null value will be returned");
  return null;
 }
 int rand = ThreadLocalRandom.current().nextInt(_totalPoints);
 return _cumulativePointsMap.higherEntry(rand).getValue();
}

代码示例来源:origin: com.linkedin.parseq/parseq

long getStallsSince(long lastUpdate) {
 long stall = 0;
 Entry<Long, Long> entry = _stalls.ceilingEntry(lastUpdate);
 while(entry != null) {
  stall += entry.getValue();
  entry = _stalls.higherEntry(entry.getKey());
 }
 return stall;
}

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

/**
 * @param chainId
 * @return The first {@link ResidueNumber} of the specified chain (the one highest down in the PDB file)
 */
public ResidueNumber getFirst(String chainId) {
  Map.Entry<ResidueNumber,Integer> entry = treeMap.firstEntry();
  while (true) {
    if (entry.getKey().getChainName().equals(chainId)) return entry.getKey();
    entry = treeMap.higherEntry(entry.getKey());
    if (entry == null) return null;
  }
}

代码示例来源:origin: MSGFPlus/msgfplus

public float getPepFDR(float score) {
  float fdr;
  if (isGreaterBetter)
    fdr = pepLevelFDRMap.lowerEntry(score).getValue();
  else
    fdr = pepLevelFDRMap.higherEntry(score).getValue();
  return fdr;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private boolean isSameAsNext(Long key, Resource capacity) {
 Entry<Long, Resource> next = cumulativeCapacity.higherEntry(key);
 return (next != null && next.getValue().equals(capacity));
}

代码示例来源:origin: MSGFPlus/msgfplus

public float getPSMQValue(float score) {
  float fdr;
  if (isGreaterBetter)
    fdr = psmLevelFDRMap.lowerEntry(score).getValue();
  else
    fdr = psmLevelFDRMap.higherEntry(score).getValue();
  return fdr;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private boolean isSameAsNext(Long key, Resource capacity) {
 Entry<Long, Resource> next = cumulativeCapacity.higherEntry(key);
 return (next != null && next.getValue().equals(capacity));
}

代码示例来源:origin: mayconbordin/streaminer

@Override
public Bin<T> higher(double p) {
 return binFromEntry(_bins.higherEntry(p));
}

代码示例来源:origin: org.renci.ahab/libndl

public boolean isManagedSubnet(Inet4Address ip, int mask_length) {
  int ip_int = InetAddresses.coerceToInteger(ip);
  Entry<Integer, Integer> prev = managedSubnetTreeMap.floorEntry(ip_int);
  Entry<Integer, Integer> next = managedSubnetTreeMap.higherEntry(ip_int);
  if (prev.getKey() + prev.getValue() < ip_int
      && next.getKey() > ip_int
          + IP4Subnet.getSizeFromMask(mask_length))
    return false;
  return true;
}

相关文章