java.util.TreeSet.lower()方法的使用及代码示例

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

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

TreeSet.lower介绍

暂无

代码示例

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

PipelineTimelineEntry naturalOrderBefore(PipelineTimelineEntry pipelineTimelineEntry) {
  naturalOrderLock.readLock().lock();
  try {
    return naturalOrderPmm.get(new CaseInsensitiveString(pipelineTimelineEntry.getPipelineName())).lower(pipelineTimelineEntry);
  } finally {
    naturalOrderLock.readLock().unlock();
  }
}

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

@Override
public E lower(E e) {
 return set().lower(e);
}

代码示例来源:origin: org.apache.poi/poi-ooxml

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;
}

代码示例来源:origin: wdullaer/MaterialDateTimePicker

Calendar newCalendar = null;
Calendar higher = selectableDays.ceiling(calendar);
Calendar lower = selectableDays.lower(calendar);

代码示例来源:origin: apache/hbase

/**
 * 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);
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * 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);
}

代码示例来源:origin: org.bitbucket.ibencher/vagabond

private void finishRanking () {
  rankDone = true;
  numExplSets = ranking.size();
  FullExplSummary s = ranking.last();
  while (!s.seInit) {
    s.computeScore();
    s = ranking.lower(s);
  }
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * 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);
}

代码示例来源:origin: MCMrARM/revolution-irc

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());
  }
}

代码示例来源:origin: MCMrARM/revolution-irc

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());
  }
}

代码示例来源:origin: stackoverflow.com

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

代码示例来源:origin: org.bitbucket.ibencher/vagabond

@Override
public IExplanationSet previous() {
  if (--iteratorPosition < 0)
    throw new NoSuchElementException("try to get element before first");
  currentIteratorElement = sortedSets.lower(currentIteratorElement);
  return getSetForRankedListElem(currentIteratorElement);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

@Override
public Object lower(Object e) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.lower(e);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

@Override
public Object lower(Object e) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.lower(e);
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

@Override
public Object lower(Object e) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.lower(e);
}

代码示例来源:origin: org.bitbucket.ibencher/vagabond

@Override
public IExplanationSet previous() {
  assert(hasPrevious());
  
  curIterElem = ranking.lower(curIterElem);
  iterPos--;
  return generateExplanation (curIterElem);
}

代码示例来源:origin: org.apache.openjpa/openjpa-kernel

@Override
public Object lower(Object e) {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.lower(e);
}

代码示例来源:origin: freenet/fred

/** 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);
}

代码示例来源:origin: FenixEdu/fenixedu-academic

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);
}

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

@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.
  }

相关文章