2 * Created on Aug 5, 2007
4 * Copyright (c) 2007, the JUNG Project and the Regents of the University
8 * This software is open-source under the BSD license; see either
10 * http://jung.sourceforge.net/license.txt for a description.
12 package edu.uci.ics.jung.algorithms.util;
18 * A <code>SettableTransformer</code> that operates on an underlying <code>Map</code> instance.
19 * Similar to <code>MapTransformer</code>.
21 * @author Joshua O'Madadhain
23 public class MapSettableTransformer<I, O> implements SettableTransformer<I, O>
25 protected Map<I,O> map;
28 * Creates an instance based on <code>m</code>.
30 public MapSettableTransformer(Map<I,O> m)
35 public O transform(I input)
37 return map.get(input);
40 public void set(I input, O output)
42 map.put(input, output);