本文整理了Java中java.util.TreeMap.lastEntry()
方法的一些代码示例,展示了TreeMap.lastEntry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TreeMap.lastEntry()
方法的具体详情如下:
包路径:java.util.TreeMap
类名称:TreeMap
方法名:lastEntry
暂无
代码示例来源:origin: apache/storm
public Object getLastState() {
if (_curr.isEmpty()) {
return null;
} else {
return _curr.lastEntry().getValue();
}
}
代码示例来源:origin: alibaba/jstorm
public Object getLastState() {
if (_curr.isEmpty())
return null;
else
return _curr.lastEntry().getValue();
}
代码示例来源:origin: alibaba/jstorm
public Object getLastState() {
if(_curr.isEmpty()) return null;
else return _curr.lastEntry().getValue();
}
代码示例来源:origin: alibaba/mdrill
public Object getLastState() {
if(_curr.isEmpty()) return null;
else return _curr.lastEntry().getValue();
}
代码示例来源:origin: syncany/syncany
/**
* Returns the last file version in this instance of the partial file history,
* or <tt>null</tt> if there are no file versions.
*
* <p>Note that this method does not necessarily return the actual overall
* last file version, only the last of this object instance.
*
* @return Returns the last file version, or <tt>null</tt>
*/
public FileVersion getLastVersion() {
if (versions.isEmpty()) {
return null;
}
return versions.lastEntry().getValue();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public FileStream getLastStream() {
FileStream lastStream = null;
if ( indexMap.size() > 0 ) {
lastStream = indexMap.lastEntry().getValue().getFileStream();
}
return lastStream;
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Double predict(Vector input) {
TreeMap<Double, Double> maxMargins = new TreeMap<>();
models.forEach((k, v) -> maxMargins.put(v.predict(input), k));
// returns value the most closest to 1
return maxMargins.lastEntry().getValue();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public String getLastFileName() {
String filename = null;
if ( indexMap.size() > 0 ) {
filename = indexMap.lastEntry().getValue().getFileName();
}
return filename;
}
代码示例来源:origin: graphhopper/graphhopper
protected int handlePriority(ReaderWay way, int priorityFromRelation) {
TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>();
if (priorityFromRelation == 0)
weightToPrioMap.put(0d, UNCHANGED.getValue());
else
weightToPrioMap.put(110d, priorityFromRelation);
collect(way, weightToPrioMap);
// pick priority with biggest order value
return weightToPrioMap.lastEntry().getValue();
}
代码示例来源:origin: graphhopper/graphhopper
/**
* In this method we prefer cycleways or roads with designated bike access and avoid big roads
* or roads with trams or pedestrian.
* <p>
*
* @return new priority based on priorityFromRelation and on the tags in ReaderWay.
*/
protected int handlePriority(ReaderWay way, double wayTypeSpeed, int priorityFromRelation) {
TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>();
if (priorityFromRelation == 0)
weightToPrioMap.put(0d, UNCHANGED.getValue());
else
weightToPrioMap.put(110d, priorityFromRelation);
collect(way, wayTypeSpeed, weightToPrioMap);
// pick priority with biggest order value
return weightToPrioMap.lastEntry().getValue();
}
代码示例来源:origin: apache/incubator-druid
private void remove(
NavigableMap<Interval, TimelineEntry> timeline,
Interval interval,
boolean incompleteOk
)
{
timeline.remove(interval);
for (Map.Entry<Interval, TreeMap<VersionType, TimelineEntry>> versionEntry : allTimelineEntries.entrySet()) {
if (versionEntry.getKey().overlap(interval) != null) {
if (incompleteOk) {
add(timeline, versionEntry.getKey(), versionEntry.getValue().lastEntry().getValue());
} else {
for (VersionType ver : versionEntry.getValue().descendingKeySet()) {
TimelineEntry timelineEntry = versionEntry.getValue().get(ver);
if (timelineEntry.getPartitionHolder().isComplete()) {
add(timeline, versionEntry.getKey(), timelineEntry);
break;
}
}
}
}
}
}
代码示例来源:origin: apache/incubator-pinot
if (_numValuesAdded >= _trimSize) {
Map.Entry<Comparable, List<ImmutablePair<String, Object>>> maxEntry = _treeMap.lastEntry();
Comparable maxKey = maxEntry.getKey();
if (_comparator.compare(newKey, maxKey) < 0) {
代码示例来源:origin: stanfordnlp/CoreNLP
public String getLearnedWordsAsJsonLastIteration(){
JsonObjectBuilder obj = Json.createObjectBuilder();
for(String label: getLabels()){
Counter<CandidatePhrase> learnedWords = getLearnedWordsEachIter(label).lastEntry().getValue();
JsonArrayBuilder arr = Json.createArrayBuilder();
for(CandidatePhrase k: learnedWords.keySet())
arr.add(k.getPhrase());
obj.add(label, arr);
}
return obj.build().toString();
}
代码示例来源:origin: apache/ignite
.mapToDouble(x -> x.isEmpty() ? 0.0 : x.lastEntry().getValue())
.toArray();
代码示例来源:origin: apache/incubator-druid
if (endOffsets.equals(taskGroup.checkpointSequences.lastEntry().getValue())) {
log.warn(
"Checkpoint [%s] is same as the start sequences [%s] of latest sequence for the task group [%d]",
endOffsets,
taskGroup.checkpointSequences.lastEntry().getValue(),
taskGroup.groupId
);
代码示例来源:origin: stanfordnlp/CoreNLP
alreadyLearnedIters.put(label, model.constVars.getLearnedWordsEachIter().get(label).lastEntry().getKey());
代码示例来源:origin: apache/incubator-gobblin
|| peekNode.children.lastEntry().getValue() == _lastVisited) {
代码示例来源:origin: apache/ignite
TreeMap<Integer, Double> y2sDistrib = sumOfSquaredLabels.computeDistributionFunction();
double cntrMax = cntrDistrib.lastEntry().getValue();
double ysMax = ysDistrib.lastEntry().getValue();
double y2sMax = y2sDistrib.lastEntry().getValue();
代码示例来源:origin: apache/incubator-druid
Assert.assertEquals(expectedIntervals.get(1), results.lastKey());
Assert.assertEquals(1, results.firstEntry().getValue().get(DataSourcesResource.SimpleProperties.count));
Assert.assertEquals(1, results.lastEntry().getValue().get(DataSourcesResource.SimpleProperties.count));
代码示例来源:origin: apache/hbase
clusterState.lastEntry().getValue().add(replica1);
clusterState.lastEntry().getValue().add(replica2);
clusterState.lastEntry().getValue().add(replica2);
clusterState.lastEntry().getValue().add(replica3);
内容来源于网络,如有侵权,请联系作者删除!