public Object getLastState() { if (_curr.isEmpty()) { return null; } else { return _curr.lastEntry().getValue(); } }
public Object getLastState() { if (_curr.isEmpty()) return null; else return _curr.lastEntry().getValue(); }
public Object getLastState() { if(_curr.isEmpty()) return null; else return _curr.lastEntry().getValue(); }
public Object getLastState() { if(_curr.isEmpty()) return null; else return _curr.lastEntry().getValue(); }
/** * 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(); }
@Override public FileStream getLastStream() { FileStream lastStream = null; if ( indexMap.size() > 0 ) { lastStream = indexMap.lastEntry().getValue().getFileStream(); } return lastStream; }
/** {@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(); }
@Override public String getLastFileName() { String filename = null; if ( indexMap.size() > 0 ) { filename = indexMap.lastEntry().getValue().getFileName(); } return filename; }
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(); }
/** * 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(); }
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; } } } } } }
if (_numValuesAdded >= _trimSize) { Map.Entry<Comparable, List<ImmutablePair<String, Object>>> maxEntry = _treeMap.lastEntry(); Comparable maxKey = maxEntry.getKey(); if (_comparator.compare(newKey, maxKey) < 0) {
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(); }
.mapToDouble(x -> x.isEmpty() ? 0.0 : x.lastEntry().getValue()) .toArray();
alreadyLearnedIters.put(label, model.constVars.getLearnedWordsEachIter().get(label).lastEntry().getKey());
|| peekNode.children.lastEntry().getValue() == _lastVisited) {
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));