| Modifier and Type | Class and Description |
|---|---|
| private class | Memoizer.KeyStorage
Composite-key map. |
| private class | Memoizer.MemoizerKey
Key for composite-key map. |
| Modifier and Type | Field and Description |
|---|---|
| private final ConcurrentMap | |
| private final Memoizer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public V | compute(final ComputableTask<A, V> c, final A
argument for computation taskArg)Implements org. |
| public void | forget(ComputableTask<A, V>
computable task, forming part of result key task, A argument of computation key)Forgets result of the specified task. |
| public void |
| cache | back to summary |
|---|---|
| private final ConcurrentMap<Memoizer<A, V>. | |
| keyStorage | back to summary |
|---|---|
| private final Memoizer<A, V>. | |
| Memoizer | back to summary |
|---|---|
| public Memoizer() | |
| compute | back to summary |
|---|---|
| public V compute(final ComputableTask<A, V> c, final A taskArg) throws InterruptedException Implements org. Doc from org. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| forget | back to summary |
|---|---|
| public void forget(ComputableTask<A, V> task, A key) Forgets result of the specified task. This allows to manually control size of internal cache.
| |
| forgetAll | back to summary |
|---|---|
| public void forgetAll() Forgets all cached results. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Memoizer |
| map | back to summary |
|---|---|
| pack-priv Map<Memoizer<A, V>. | |
| KeyStorage | back to summary |
|---|---|
| private KeyStorage() | |
| get | back to summary |
|---|---|
| public Memoizer | |
| Modifier and Type | Field and Description |
|---|---|
| private final A | |
| private final ComputableTask |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public int |
| key | back to summary |
|---|---|
| private final A key | |
| task | back to summary |
|---|---|
| private final ComputableTask<A, V> task | |
| MemoizerKey | back to summary |
|---|---|
| private MemoizerKey(ComputableTask<A, V> task, A key) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |