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

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

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

TreeSet.descendingSet介绍

暂无

代码示例

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

/**
 * {@inheritDoc}
 *
 * @see java.util.NavigableSet#descendingIterator()
 * @since 1.6
 */
public Iterator<E> descendingIterator() {
  return descendingSet().iterator();
}

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

private List<Long> loadIdsFromHistory(Map<CaseInsensitiveString, TreeSet<Long>> result) {
  List<Long> idsForHistory = new ArrayList<Long>();
  try {
    activePipelineReadLock.lock();
    for (Map.Entry<CaseInsensitiveString, TreeSet<Long>> pipelineToIds : result.entrySet()) {
      idsForHistory.addAll(pipelineToIds.getValue().descendingSet());
    }
  } finally {
    activePipelineReadLock.unlock();
  }
  return idsForHistory;
}

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

@Override
public NavigableSet<E> descendingSet() {
 return set().descendingSet();
}

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

/**
 * Removes a number of merged regions of cells (hence letting them free)
 *
 * @param indices A set of the regions to unmerge
 */
@Override
public void removeMergedRegions(Collection<Integer> indices) {
  for (int i : (new TreeSet<>(indices)).descendingSet()) {
    _sheet.removeMergedRegion(i);
  }
}

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

return F.t(min, max); // Short path.
for (Long idx : archiveIndices.descendingSet()) {
  if (!archiveIndices.contains(idx - 1))
    return F.t(idx, max);

代码示例来源:origin: stanfordnlp/CoreNLP

for (Pair<Double,String> pair : sortedLabels.descendingSet()) {
 if (builder.length() > 0) {
  builder.append('\t');

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

.descendingSet()) {
if (this.comparator.compare(dropCandidate.getT(), newElement.getT()) <= 0) {
 log.debug("Cannot evict enough requests to fit request {}. " + "Rejecting", newElement.getT());

代码示例来源:origin: org.springframework.boot/spring-boot-actuator

private NavigableSet<LogLevel> getLevels() {
  Set<LogLevel> levels = this.loggingSystem.getSupportedLogLevels();
  return new TreeSet<>(levels).descendingSet();
}

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

/**
 * @param histogram a histogram that represents the frequencies of tags
 */
public void optimizeWayOrdering(TShortIntHashMap histogram) {
  this.optimizedWayIds.clear();
  final TreeSet<HistogramEntry> wayOrdering = new TreeSet<>();
  histogram.forEachEntry(new TShortIntProcedure() {
    @Override
    public boolean execute(short tag, int amount) {
      wayOrdering.add(new HistogramEntry(tag, amount));
      return true;
    }
  });
  short tmpWayID = 0;
  OSMTag currentTag = null;
  for (HistogramEntry histogramEntry : wayOrdering.descendingSet()) {
    currentTag = this.idToWayTag.get(Short.valueOf(histogramEntry.id));
    this.optimizedWayIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpWayID));
    LOGGER.finer("adding way tag: " + currentTag.tagKey() + " id:" + tmpWayID + " amount: "
        + histogramEntry.amount);
    tmpWayID++;
  }
}

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

/**
 * @param histogram a histogram that represents the frequencies of tags
 */
public void optimizePoiOrdering(TShortIntHashMap histogram) {
  this.optimizedPoiIds.clear();
  final TreeSet<HistogramEntry> poiOrdering = new TreeSet<>();
  histogram.forEachEntry(new TShortIntProcedure() {
    @Override
    public boolean execute(short tag, int amount) {
      poiOrdering.add(new HistogramEntry(tag, amount));
      return true;
    }
  });
  short tmpPoiID = 0;
  OSMTag currentTag = null;
  for (HistogramEntry histogramEntry : poiOrdering.descendingSet()) {
    currentTag = this.idToPoiTag.get(Short.valueOf(histogramEntry.id));
    this.optimizedPoiIds.put(Short.valueOf(histogramEntry.id), Short.valueOf(tmpPoiID));
    LOGGER.finer("adding poi tag: " + currentTag.tagKey() + " id:" + tmpPoiID + " amount: "
        + histogramEntry.amount);
    tmpPoiID++;
  }
}

代码示例来源:origin: resteasy/Resteasy

@Override
public NavigableSet<E> descendingSet() {
  NavigableSet<E> descendingSet = super.descendingSet();
  return  new UnmodifiableTreeSet<>(descendingSet.comparator(), descendingSet);
}

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

/**
 * {@inheritDoc}
 *
 * @see java.util.NavigableSet#descendingIterator()
 * @since 1.6
 */
public Iterator<E> descendingIterator() {
  return descendingSet().iterator();
}

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

/**
 * {@inheritDoc}
 *
 * @see java.util.NavigableSet#descendingIterator()
 * @since 1.6
 */
public Iterator<E> descendingIterator() {
  return descendingSet().iterator();
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-task-core

@Override
public Page<TaskExecution> findAll(Pageable pageable) {
  TreeSet<TaskExecution> sortedSet = getTaskExecutionTreeSet();
  sortedSet.addAll(taskExecutions.values());
  List<TaskExecution> result = new ArrayList<>(sortedSet.descendingSet());
  return getPageFromList(result, pageable, getTaskExecutionCount());
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

/**
 * Make a warnings guard that's the same as this one but demotes all
 * errors to warnings.
 */
ComposeWarningsGuard makeEmergencyFailSafeGuard() {
 ComposeWarningsGuard safeGuard = new ComposeWarningsGuard();
 safeGuard.demoteErrors = true;
 for (WarningsGuard guard : guards.descendingSet()) {
  safeGuard.addGuard(guard);
 }
 return safeGuard;
}

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

@Override
public NavigableSet descendingSet() {
  if (!_directAccess && isDelayLoad()) {
    load();
  }
  return super.descendingSet();
}

代码示例来源:origin: com.google.javascript/closure-compiler

/**
 * Make a warnings guard that's the same as this one but demotes all
 * errors to warnings.
 */
ComposeWarningsGuard makeEmergencyFailSafeGuard() {
 ComposeWarningsGuard safeGuard = new ComposeWarningsGuard();
 safeGuard.demoteErrors = true;
 for (WarningsGuard guard : guards.descendingSet()) {
  safeGuard.addGuard(guard);
 }
 return safeGuard;
}

代码示例来源:origin: org.jboss.resteasy/resteasy-core

@Override
public NavigableSet<E> descendingSet() {
  NavigableSet<E> descendingSet = super.descendingSet();
  return  new UnmodifiableTreeSet<>(descendingSet.comparator(), descendingSet);
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
protected ComposeWarningsGuard makeNonStrict() {
 ComposeWarningsGuard nonStrictGuard = new ComposeWarningsGuard();
 for (WarningsGuard guard : guards.descendingSet()) {
  if (!(guard instanceof StrictWarningsGuard)) {
   nonStrictGuard.addGuard(guard.makeNonStrict());
  }
 }
 return nonStrictGuard;
}

代码示例来源:origin: com.google.javascript/closure-compiler

@Override
protected ComposeWarningsGuard makeNonStrict() {
 ComposeWarningsGuard nonStrictGuard = new ComposeWarningsGuard();
 for (WarningsGuard guard : guards.descendingSet()) {
  if (!(guard instanceof StrictWarningsGuard)) {
   nonStrictGuard.addGuard(guard.makeNonStrict());
  }
 }
 return nonStrictGuard;
}

相关文章