Package org.directmemory

Examples of org.directmemory.CacheStore.removeLast()


    cache.put("test1", new DummyPojo("test1", 1024));
    cache.put("test2", new DummyPojo("test2", 1024));
    cache.put("test3", new DummyPojo("test3", 1024));
    cache.put("test4", new DummyPojo("test4", 1024));
    cache.put("test5", new DummyPojo("test5", 1024));
    CacheEntry last = cache.removeLast();
    // should be the first one inserted
    assertEquals("test1", last.key);
    cache.get("test2");
    // accessing an element should put it back at the beginning of the list
    last = cache.removeLast();
View Full Code Here


    CacheEntry last = cache.removeLast();
    // should be the first one inserted
    assertEquals("test1", last.key);
    cache.get("test2");
    // accessing an element should put it back at the beginning of the list
    last = cache.removeLast();
    // so the last should be now test3
    assertEquals("test3", last.key);
    cache.reset();
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.