Search in sources :

Example 26 with NavigableMap

use of java.util.NavigableMap in project mapdb by jankotek.

the class TreeSubMapTest method testDescendingClear.

/**
     * clear removes all pairs
     */
public void testDescendingClear() {
    NavigableMap map = dmap5();
    map.clear();
    assertEquals(0, map.size());
}
Also used : NavigableMap(java.util.NavigableMap)

Example 27 with NavigableMap

use of java.util.NavigableMap in project mapdb by jankotek.

the class TreeSubMapTest method testFloorEntry.

/**
     * floorEntry returns preceding entry.
     */
public void testFloorEntry() {
    NavigableMap map = map5();
    Map.Entry e1 = map.floorEntry(three);
    assertEquals(three, e1.getKey());
    Map.Entry e2 = map.floorEntry(six);
    assertEquals(five, e2.getKey());
    Map.Entry e3 = map.floorEntry(one);
    assertEquals(one, e3.getKey());
    Map.Entry e4 = map.floorEntry(zero);
    assertNull(e4);
}
Also used : NavigableMap(java.util.NavigableMap) TreeMap(java.util.TreeMap) Map(java.util.Map) NavigableMap(java.util.NavigableMap) SortedMap(java.util.SortedMap)

Example 28 with NavigableMap

use of java.util.NavigableMap in project mapdb by jankotek.

the class TreeSubMapTest method testGet.

/**
     * get returns the correct element at the given key,
     * or null if not present
     */
public void testGet() {
    NavigableMap map = map5();
    assertEquals("A", (String) map.get(one));
    NavigableMap empty = map0();
    assertNull(empty.get(one));
}
Also used : NavigableMap(java.util.NavigableMap)

Example 29 with NavigableMap

use of java.util.NavigableMap in project mapdb by jankotek.

the class TreeSubMapTest method testIsEmpty.

/**
     * isEmpty is true of empty map and false for non-empty
     */
public void testIsEmpty() {
    NavigableMap empty = map0();
    NavigableMap map = map5();
    assertTrue(empty.isEmpty());
    assertFalse(map.isEmpty());
}
Also used : NavigableMap(java.util.NavigableMap)

Example 30 with NavigableMap

use of java.util.NavigableMap in project mapdb by jankotek.

the class TreeSubMapTest method testRemove1_NullPointerException.

/**
     * remove(null) throws NPE
     */
public void testRemove1_NullPointerException() {
    NavigableMap c = map5();
    try {
        c.remove(null);
        shouldThrow();
    } catch (NullPointerException success) {
    }
}
Also used : NavigableMap(java.util.NavigableMap)

Aggregations

NavigableMap (java.util.NavigableMap)170 Map (java.util.Map)84 TreeMap (java.util.TreeMap)61 SortedMap (java.util.SortedMap)34 ArrayList (java.util.ArrayList)33 List (java.util.List)27 Iterator (java.util.Iterator)21 HashMap (java.util.HashMap)20 Cell (org.apache.hadoop.hbase.Cell)20 Result (org.apache.hadoop.hbase.client.Result)18 Set (java.util.Set)14 Get (org.apache.hadoop.hbase.client.Get)13 IOException (java.io.IOException)12 KeyValue (org.apache.hadoop.hbase.KeyValue)10 Put (org.apache.hadoop.hbase.client.Put)10 Test (org.junit.Test)10 Entry (java.util.Map.Entry)9 Update (co.cask.cdap.data2.dataset2.lib.table.Update)7 TestSuite (junit.framework.TestSuite)7 ImmutableMap (com.google.common.collect.ImmutableMap)6