PipelineTimelineEntry naturalOrderBefore(PipelineTimelineEntry pipelineTimelineEntry) { naturalOrderLock.readLock().lock(); try { return naturalOrderPmm.get(new CaseInsensitiveString(pipelineTimelineEntry.getPipelineName())).lower(pipelineTimelineEntry); } finally { naturalOrderLock.readLock().unlock(); } }
@Override public E lower(E e) { return set().lower(e); }
private List<CTCol> getOverlappingCols(final CTCol newCol, final TreeSet<CTCol> trackedCols) { CTCol lower = trackedCols.lower(newCol); NavigableSet<CTCol> potentiallyOverlapping = lower == null ? trackedCols : trackedCols.tailSet(lower, overlaps(lower, newCol)); List<CTCol> overlapping = new ArrayList<>(); for (CTCol existing : potentiallyOverlapping) { if (overlaps(newCol, existing)) { overlapping.add(existing); } else { break; } } return overlapping; }
Calendar newCalendar = null; Calendar higher = selectableDays.ceiling(calendar); Calendar lower = selectableDays.lower(calendar);
/** * Pick the next cell that the scanner should seek to. Since this can skip any number of cells * any of which can be a delete this can resurect old data. * * The method will only be used if canHint was set to true while creating the filter. * * @throws IOException This will never happen. */ @Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (!canHint) { return null; } Long nextTimestampObject = timestamps.lower(currentCell.getTimestamp()); if (nextTimestampObject == null) { // This should only happen if the current column's // timestamp is below the last one in the list. // // It should never happen as the filterCell should return NEXT_COL // but it's always better to be extra safe and protect against future // behavioral changes. return PrivateCellUtil.createLastOnRowCol(currentCell); } // Since we know the nextTimestampObject isn't null here there must still be // timestamps that can be included. Cast the Long to a long and return the // a cell with the current row/cf/col and the next found timestamp. long nextTimestamp = nextTimestampObject; return PrivateCellUtil.createFirstOnRowColTS(currentCell, nextTimestamp); }
/** * Pick the next cell that the scanner should seek to. Since this can skip any number of cells * any of which can be a delete this can resurect old data. * * The method will only be used if canHint was set to true while creating the filter. * * @throws IOException This will never happen. */ @Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (!canHint) { return null; } Long nextTimestampObject = timestamps.lower(currentCell.getTimestamp()); if (nextTimestampObject == null) { // This should only happen if the current column's // timestamp is below the last one in the list. // // It should never happen as the filterCell should return NEXT_COL // but it's always better to be extra safe and protect against future // behavioral changes. return PrivateCellUtil.createLastOnRowCol(currentCell); } // Since we know the nextTimestampObject isn't null here there must still be // timestamps that can be included. Cast the Long to a long and return the // a cell with the current row/cf/col and the next found timestamp. long nextTimestamp = nextTimestampObject; return PrivateCellUtil.createFirstOnRowColTS(currentCell, nextTimestamp); }
private void finishRanking () { rankDone = true; numExplSets = ranking.size(); FullExplSummary s = ranking.last(); while (!s.seInit) { s.computeScore(); s = ranking.lower(s); } }
/** * Obtains the entry that is located before the one provided. * * @param entry the map entry to get the previous one for; must belong to the map * @return the entry before the provided one, {@code null} if {@code entry} is the first entry * in the map */ @Nullable FileUseMapEntry<?> before(@Nonnull FileUseMapEntry<?> entry) { Preconditions.checkNotNull(entry, "entry == null"); return mMap.lower(entry); }
private void addDeletionCandidate(DeletionCandidate candidate) { if (mDeletionCandidates.size() < CONNECTION_DELETION_CANDIDATES) { mDeletionCandidates.add(candidate); } else if (mDeletionCandidates.lower(candidate) != null) { mDeletionCandidates.add(candidate); mDeletionCandidates.remove(mDeletionCandidates.last()); } }
private void addGlobalDeletionCandidate(DeletionCandidate candidate) { if (mGlobalDeletionCandidates.size() < GLOBAL_DELETION_CANDIDATES) { mGlobalDeletionCandidates.add(candidate); } else if (mGlobalDeletionCandidates.lower(candidate) != null) { mGlobalDeletionCandidates.add(candidate); mGlobalDeletionCandidates.remove(mGlobalDeletionCandidates.last()); } }
TreeSet<String> set = new TreeSet<>( Arrays.asList("a", "z", "b", "y")); String cur; cur = set.first(); // a cur = set.higher(cur); // b cur = set.higher(cur); // y cur = set.higher(cur); // z cur = set.lower(cur); // y cur = set.lower(cur); // b cur = set.lower(cur); // a cur = set.lower(cur); // null
@Override public IExplanationSet previous() { if (--iteratorPosition < 0) throw new NoSuchElementException("try to get element before first"); currentIteratorElement = sortedSets.lower(currentIteratorElement); return getSetForRankedListElem(currentIteratorElement); }
@Override public Object lower(Object e) { if (!_directAccess && isDelayLoad()) { load(); } return super.lower(e); }
@Override public Object lower(Object e) { if (!_directAccess && isDelayLoad()) { load(); } return super.lower(e); }
@Override public Object lower(Object e) { if (!_directAccess && isDelayLoad()) { load(); } return super.lower(e); }
@Override public IExplanationSet previous() { assert(hasPrevious()); curIterElem = ranking.lower(curIterElem); iterPos--; return generateExplanation (curIterElem); }
@Override public Object lower(Object e) { if (!_directAccess && isDelayLoad()) { load(); } return super.lower(e); }
/** Finds all ranges that overlap or touch the given range. */ private NavigableSet<Range> overlaps(int start, int end, boolean includeTouching) { // Establish bounds on start times to select ranges that would overlap or touch Range startRange = new Range(start, 0); Range lower = ranges.lower(startRange); if (lower != null && lower.end >= (includeTouching ? start - 1 : start)) { // This range would overlap (or touch, if those are to be included) startRange = new Range(lower.start, 0); } Range endRange = new Range(end + 1, 0); // Any range with start time within startRange and endRange would touch or overlap return ranges.subSet(startRange, true, endRange, includeTouching); }
public ActionForward moveUp(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { final PhdThesisProcess process = getProcess(request); final ThesisJuryElement juryElement = getJuryElement(request); final ThesisJuryElement lower = process.getOrderedThesisJuryElements().lower(juryElement); if (lower != null) { swapJuryElements(request, juryElement, lower); } return manageThesisJuryElements(mapping, actionForm, request, response); }
@Test public void testLoopNestTree() { TreeSet<String> lnt = loopFinder.getLoopNestTreeSet(); Assert.assertTrue(lnt.lower("5").equals("8")); Assert.assertTrue(lnt.higher("8").equals("5")); Assert.assertTrue(lnt.higher("2")==null); // while (!lnt.isEmpty()) { // System.err.println(lnt.pollFirst()); //TODO more testing needed. }