hudson.util
Class Memoizer<K,V>

java.lang.Object
  extended by hudson.util.Memoizer<K,V>

public abstract class Memoizer<K,V>
extends Object

Implements memoization semantics.

Conceptually a function from K -> V that computes values lazily and remembers the results. Often used to implement a data store per key.

Since:
1.281
Author:
Kohsuke Kawaguchi

Constructor Summary
Memoizer()
           
 
Method Summary
 void clear()
          Clears all the computed values.
abstract  V compute(K key)
          Creates a new instance.
 V get(K key)
           
 Iterable<V> values()
          Provides a snapshot view of all Vs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Memoizer

public Memoizer()
Method Detail

get

public V get(K key)

compute

public abstract V compute(K key)
Creates a new instance.


clear

public void clear()
Clears all the computed values.


values

public Iterable<V> values()
Provides a snapshot view of all Vs.



Copyright © 2004-2013. All Rights Reserved.