本文整理匯總了Java中java.util.TreeMap.navigableKeySet方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeMap.navigableKeySet方法的具體用法?Java TreeMap.navigableKeySet怎麽用?Java TreeMap.navigableKeySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.TreeMap
的用法示例。
在下文中一共展示了TreeMap.navigableKeySet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testKeySetDescendingIteratorOrder
import java.util.TreeMap; //導入方法依賴的package包/類
/**
* descending iterator of key set is inverse ordered
*/
public void testKeySetDescendingIteratorOrder() {
TreeMap map = map5();
NavigableSet s = map.navigableKeySet();
Iterator i = s.descendingIterator();
Integer last = (Integer)i.next();
assertEquals(last, five);
int count = 1;
while (i.hasNext()) {
Integer k = (Integer)i.next();
assertTrue(last.compareTo(k) > 0);
last = k;
++count;
}
assertEquals(5, count);
}
示例2: TemplateListAdapter
import java.util.TreeMap; //導入方法依賴的package包/類
public TemplateListAdapter(Context context, View view, int resource) {
mView = view;
mSpinner = (Spinner) view.findViewById(R.id.spTemplate);
// Get restriction categories
TreeMap<String, String> tmRestriction = PrivacyManager.getRestrictions(context);
listRestrictionName = new ArrayList<String>(tmRestriction.values());
listLocalizedTitle = new ArrayList<String>(tmRestriction.navigableKeySet());
int userId = Util.getUserId(Process.myUid());
ondemand = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingOnDemand, true);
version = new Version(Util.getSelfVersionName(context));
}