net.fortytwo.ripple
Class ListMemoizer<T,M>

java.lang.Object
  extended by 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)

Constructor Summary
ListMemoizer(Comparator<T> comparator)
           
 
Method Summary
 M get(ListNode<T> list)
           
 boolean put(ListNode<T> list, M memo)
          Adds a new value to the map.
 boolean remove(ListNode<T> list)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListMemoizer

public ListMemoizer(Comparator<T> comparator)
Method Detail

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 key
memo - 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.