本文整理匯總了Java中java.util.TreeMap.higherEntry方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeMap.higherEntry方法的具體用法?Java TreeMap.higherEntry怎麽用?Java TreeMap.higherEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.TreeMap
的用法示例。
在下文中一共展示了TreeMap.higherEntry方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: filterPacket
import java.util.TreeMap; //導入方法依賴的package包/類
@Override
synchronized public EventPacket<?> filterPacket(EventPacket<?> in) {
in = getEnclosedFilterChain().filterPacket(in);
maybeAddListeners(chip);
currentBoundingBoxes.clear(); // these are displayed, and returned to caller
lastTs = in.getFirstTimestamp();
BoundingBox next = null;
// either use the original boxes or the undistorted ones, depending on calibration
TreeMap<Integer, BoundingBox> usedBounndingBoxes = null;
usedBounndingBoxes = calibration.isCalibrated() && calibration.isFilterEnabled() ? calibratedBoundingBoxes : boundingBoxes;
// gets BB that is last in list and still with lower timestamp than last timestamp
Entry<Integer, BoundingBox> entry = usedBounndingBoxes.lowerEntry(lastTs);
// we do this more expensive search in case user has scrolled the file or rewound
if (entry != null && entry.getValue() != null) {
currentBoundingBoxes.add(entry.getValue());
entry = usedBounndingBoxes.higherEntry(entry.getKey());
if (entry != null) {
next = entry.getValue();
}
}
for (BasicEvent ev : in) {
lastTs = ev.timestamp; // gets next in list, then add to currentBoundingBoxes when timestamp reaches that value
if (next != null && ev.timestamp > next.timestamp) {
currentBoundingBoxes.add(next);
entry = usedBounndingBoxes.higherEntry(next.timestamp);
if (entry != null) {
next = entry.getValue();
}
}
}
return in;
}
示例2: testHigherEntry
import java.util.TreeMap; //導入方法依賴的package包/類
/**
* higherEntry returns next entry.
*/
public void testHigherEntry() {
TreeMap map = map5();
Map.Entry e1 = map.higherEntry(three);
assertEquals(four, e1.getKey());
Map.Entry e2 = map.higherEntry(zero);
assertEquals(one, e2.getKey());
Map.Entry e3 = map.higherEntry(five);
assertNull(e3);
Map.Entry e4 = map.higherEntry(six);
assertNull(e4);
}
示例3: getHigherEntry
import java.util.TreeMap; //導入方法依賴的package包/類
public void getHigherEntry(TreeMap<String,String> maps,String key){
Map.Entry<String,String> entry = maps.higherEntry(key);
System.out.println("後一個的Entry如下");
System.out.print("key = " + entry.getKey());
System.out.println(" value = " + entry.getValue());
}