java Programming Glossary: concurrentmap
Is there a SoftHashMap in Java? http://stackoverflow.com/questions/264582/is-there-a-softhashmap-in-java Collection Google Guava MapMaker does use SoftReferences A ConcurrentMap builder providing any combination of these features soft or..
ExecutorService that interrupts tasks after a timeout http://stackoverflow.com/questions/2758612/executorservice-that-interrupts-tasks-after-a-timeout Executors.newSingleThreadScheduledExecutor private final ConcurrentMap Runnable ScheduledFuture runningTasks new ConcurrentHashMap..
Concurrent Set Queue http://stackoverflow.com/questions/3120495/concurrent-set-queue Set E Queue E private enum Dummy VALUE private final ConcurrentMap E Dummy map ConcurrentHashSet ConcurrentMap E Dummy map super.. private final ConcurrentMap E Dummy map ConcurrentHashSet ConcurrentMap E Dummy map super map.keySet this.map Preconditions.checkNotNull..
Use of Google-collections MapMaker? http://stackoverflow.com/questions/3737140/use-of-google-collections-mapmaker a quick sample of one way I've used MapMaker private final ConcurrentMap Long Foo fooCache new MapMaker .softValues .makeComputingMap..
Java time-based map/cache with expiring keys http://stackoverflow.com/questions/3802370/java-time-based-map-cache-with-expiring-keys has something called MapMaker which can do exactly that. ConcurrentMap Key Graph graphs new MapMaker .concurrencyLevel 4 .softKeys..
java.util.ConcurrentModificationException on ArrayList http://stackoverflow.com/questions/5145135/java-util-concurrentmodificationexception-on-arraylist fastfail2.shtml List User users List User connectedUsers ConcurrentMap User IClient clients ... users Collections.synchronizedList..
Synchronizing on an Integer value [duplicate] http://stackoverflow.com/questions/659915/synchronizing-on-an-integer-value id p getFromDataBase id cache.store p private ConcurrentMap Integer Integer locks new ConcurrentHashMap Integer Integer.. id id return locks.get id To explain this code it uses ConcurrentMap which allows use of putIfAbsent . You could do this locks.putIfAbsent..
my ideal cache using guava http://stackoverflow.com/questions/6778743/my-ideal-cache-using-guava soft values in favor of maximumSize and expireAfterAccess ConcurrentMap String MyObject cache new MapMaker .maximumSize MAXIMUM_SIZE.. I can check to see if a data object is still in memory ConcurrentMap String MyObject interner new MapMaker .weakValues .makeMap and..
How to implement a canonicalizing mapping in Java? http://stackoverflow.com/questions/7436765/how-to-implement-a-canonicalizing-mapping-in-java to this kind of use case. So you can initialize your map ConcurrentMap Key Object cache new MapMaker .weakValues .makeMap And the immediate.. will be removed. Furthermore you can use a computing map ConcurrentMap Key Object cache new MapMaker .weakValues .makeComputingMap..
Most efficient way to increment a Map value in Java http://stackoverflow.com/questions/81346/most-efficient-way-to-increment-a-map-value-in-java import java.util.concurrent.ConcurrentMap import java.util.concurrent.atomic.AtomicLong ... final ConcurrentMap.. import java.util.concurrent.atomic.AtomicLong ... final ConcurrentMap String AtomicLong map new ConcurrentHashMap String AtomicLong..
Handle null value using Guava MapMaker/CacheBuilder http://stackoverflow.com/questions/8298285/handle-null-value-using-guava-mapmaker-cachebuilder but I don't understand how to properly handle null values. ConcurrentMap Key Graph graphs new MapMaker .concurrencyLevel 4 .weakKeys..
How to customize parameter names when binding spring mvc command objects http://stackoverflow.com/questions/8986593/how-to-customize-parameter-names-when-binding-spring-mvc-command-objects objects @CommandParameter to fieldname mappings private ConcurrentMap Class Map String String definitionsCache Maps.newConcurrentMap.. Class Map String String definitionsCache Maps.newConcurrentMap public AnnotationServletModelAttributeResolver boolean annotationNotRequired..
|