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; }
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); } }
Map.Entry<Character, UrlTrieNode> sibling = parent.children.higherEntry(_toReturn.getValue()); if (sibling == null) { _currentNode = null;
lottery.higherEntry(random.nextInt(offset)).getValue(); return winner;
/** * 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); }
protected Map.Entry nextEntry(Key key) { return tuples.higherEntry(key); }
public MediaMetadataCompat getStationAfter(String stationId) { Map.Entry<String, MediaMetadataCompat> entry = mStationListById.higherEntry(stationId); if (entry != null) { return entry.getValue(); } return null; }
public String getAnnotation(long position) { Entry<Integer, String> entry = annotations.higherEntry((int) position); if (entry != null) return entry.getValue(); else return null; }
public String getAnnotation(long position) { Entry<Integer, String> entry = annotations.higherEntry((int) position); if (entry != null) return entry.getValue(); else return null; }
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++; } }
@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; }
@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(); }
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; }
/** * @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; } }
public float getPepFDR(float score) { float fdr; if (isGreaterBetter) fdr = pepLevelFDRMap.lowerEntry(score).getValue(); else fdr = pepLevelFDRMap.higherEntry(score).getValue(); return fdr; }
private boolean isSameAsNext(Long key, Resource capacity) { Entry<Long, Resource> next = cumulativeCapacity.higherEntry(key); return (next != null && next.getValue().equals(capacity)); }
public float getPSMQValue(float score) { float fdr; if (isGreaterBetter) fdr = psmLevelFDRMap.lowerEntry(score).getValue(); else fdr = psmLevelFDRMap.higherEntry(score).getValue(); return fdr; }
private boolean isSameAsNext(Long key, Resource capacity) { Entry<Long, Resource> next = cumulativeCapacity.higherEntry(key); return (next != null && next.getValue().equals(capacity)); }
@Override public Bin<T> higher(double p) { return binFromEntry(_bins.higherEntry(p)); }
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; }