本文整理匯總了Java中java.util.concurrent.ConcurrentSkipListSet.tailSet方法的典型用法代碼示例。如果您正苦於以下問題:Java ConcurrentSkipListSet.tailSet方法的具體用法?Java ConcurrentSkipListSet.tailSet怎麽用?Java ConcurrentSkipListSet.tailSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.concurrent.ConcurrentSkipListSet
的用法示例。
在下文中一共展示了ConcurrentSkipListSet.tailSet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testTailSetContents
import java.util.concurrent.ConcurrentSkipListSet; //導入方法依賴的package包/類
/**
* tailSet returns set with keys in requested range
*/
public void testTailSetContents() {
ConcurrentSkipListSet set = set5();
SortedSet sm = set.tailSet(two);
assertFalse(sm.contains(one));
assertTrue(sm.contains(two));
assertTrue(sm.contains(three));
assertTrue(sm.contains(four));
assertTrue(sm.contains(five));
Iterator i = sm.iterator();
Object k;
k = (Integer)(i.next());
assertEquals(two, k);
k = (Integer)(i.next());
assertEquals(three, k);
k = (Integer)(i.next());
assertEquals(four, k);
k = (Integer)(i.next());
assertEquals(five, k);
assertFalse(i.hasNext());
SortedSet ssm = sm.tailSet(four);
assertEquals(four, ssm.first());
assertEquals(five, ssm.last());
assertTrue(ssm.remove(four));
assertEquals(1, ssm.size());
assertEquals(3, sm.size());
assertEquals(4, set.size());
}
示例2: set0
import java.util.concurrent.ConcurrentSkipListSet; //導入方法依賴的package包/類
private static NavigableSet set0() {
ConcurrentSkipListSet set = new ConcurrentSkipListSet();
assertTrue(set.isEmpty());
return set.tailSet(m1, true);
}