net.fortytwo.ripple
Class ListMemoizer<T,M>
java.lang.Object
net.fortytwo.ripple.ListMemoizer<T,M>
public class ListMemoizer<T,M>
- extends Object
A space-efficient map using where the key values are linked lists.
- Author:
- Joshua Shinavier (http://fortytwo.net)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListMemoizer
public ListMemoizer(Comparator<T> comparator)
get
public M get(ListNode<T> list)
put
public boolean put(ListNode<T> list,
M memo)
- Adds a new value to the map.
- Parameters:
list - the list-valued keymemo - the value to store
- Returns:
- whether the key/memo pair has been added to the store.
A return value of false indicates that this memoizer already contains a memo for the given key,
and that the new memo has not been added.
remove
public boolean remove(ListNode<T> list)
Copyright © 2007-2014. All Rights Reserved.