Package jdbm

Examples of jdbm.SecondaryTreeMap


      PrimaryStoreMap<Long,String> st = recman.storeMap("storeMap");
      SecondaryKeyExtractor<String, Long, String> extractor = new SecondaryKeyExtractor<String, Long, String>() {
      public String extractSecondaryKey(Long key, String value) {       
        return ""+key+value;
      }};
      SecondaryTreeMap t = st.secondaryTreeMap("map1",extractor);
      SecondaryHashMap h = st.secondaryHashMap("map2",extractor);
      Long key = st.putValue("aaa");
      assertTrue(t.size() == 1);
      assertTrue(t.containsKey(""+key+"aaa"));
      assertTrue(h.size() == 1);
      assertTrue(h.containsKey(""+key+"aaa"));
     
      //defrag will force reopening
      recman.defrag();
      recman.clearCache();
     
      assertTrue(t.size() == 1);
      assertTrue(t.containsKey(""+key+"aaa"));
      assertTrue(h.size() == 1);
      assertTrue(h.containsKey(""+key+"aaa"));

   
View Full Code Here

TOP

Related Classes of jdbm.SecondaryTreeMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.