Java Code Examples for java.util.concurrent.ConcurrentNavigableMap#pollLastEntry()
The following examples show how to use
java.util.concurrent.ConcurrentNavigableMap#pollLastEntry() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcurrentSkipListSubMapTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testPollLastEntry() { ConcurrentNavigableMap map = map5(); Map.Entry e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(four, e.getKey()); map.put(five, "E"); e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(three, e.getKey()); map.remove(two); e = map.pollLastEntry(); assertEquals(one, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 2
Source File: ConcurrentSkipListSubMapTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testDescendingPollLastEntry() { ConcurrentNavigableMap map = dmap5(); Map.Entry e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m4, e.getKey()); map.put(m5, "E"); e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m3, e.getKey()); map.remove(m2); e = map.pollLastEntry(); assertEquals(m1, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 3
Source File: BTreeMapTest5.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testPollLastEntry() { ConcurrentNavigableMap map = map5(); Map.Entry e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(four, e.getKey()); map.put(five, "E"); e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(three, e.getKey()); map.remove(two); e = map.pollLastEntry(); assertEquals(one, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 4
Source File: ConcurrentSkipListSubMapJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testPollLastEntry() { ConcurrentNavigableMap map = map5(); Map.Entry e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(four, e.getKey()); map.put(five, "E"); e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(three, e.getKey()); map.remove(two); e = map.pollLastEntry(); assertEquals(one, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 5
Source File: ConcurrentSkipListSubMapJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testDescendingPollLastEntry() { ConcurrentNavigableMap map = dmap5(); Map.Entry e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m4, e.getKey()); map.put(m5, "E"); e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m3, e.getKey()); map.remove(m2); e = map.pollLastEntry(); assertEquals(m1, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 6
Source File: ConcurrentSkipListSubMapJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testPollLastEntry() { ConcurrentNavigableMap map = map5(); Map.Entry e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(four, e.getKey()); map.put(five, "E"); e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(three, e.getKey()); map.remove(two); e = map.pollLastEntry(); assertEquals(one, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 7
Source File: ConcurrentSkipListSubMapJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testDescendingPollLastEntry() { ConcurrentNavigableMap map = dmap5(); Map.Entry e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m4, e.getKey()); map.put(m5, "E"); e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m3, e.getKey()); map.remove(m2); e = map.pollLastEntry(); assertEquals(m1, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 8
Source File: ConcurrentSkipListSubMapTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testPollLastEntry() { ConcurrentNavigableMap map = map5(); Map.Entry e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(four, e.getKey()); map.put(five, "E"); e = map.pollLastEntry(); assertEquals(five, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(three, e.getKey()); map.remove(two); e = map.pollLastEntry(); assertEquals(one, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }
Example 9
Source File: ConcurrentSkipListSubMapTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * pollLastEntry returns entries in order */ public void testDescendingPollLastEntry() { ConcurrentNavigableMap map = dmap5(); Map.Entry e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m4, e.getKey()); map.put(m5, "E"); e = map.pollLastEntry(); assertEquals(m5, e.getKey()); assertEquals("E", e.getValue()); e = map.pollLastEntry(); assertEquals(m3, e.getKey()); map.remove(m2); e = map.pollLastEntry(); assertEquals(m1, e.getKey()); try { e.setValue("E"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollLastEntry(); assertNull(e); }