2 * Created on Jul 18, 2008
4 * Copyright (c) 2008, 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.scoring.util;
14 import org.apache.commons.collections15.Transformer;
16 import edu.uci.ics.jung.algorithms.scoring.VertexScorer;
19 * A Transformer convenience wrapper around VertexScorer.
21 public class VertexScoreTransformer<V, S> implements Transformer<V, S>
24 * The VertexScorer instance that provides the values returned by <code>transform</code>.
26 protected VertexScorer<V,S> vs;
29 * Creates an instance based on the specified VertexScorer.
31 public VertexScoreTransformer(VertexScorer<V,S> vs)
37 * Returns the score for this vertex.
39 public S transform(V v)
41 return vs.getVertexScore(v);