source: branches/localSpectral/src/clustering/ListSeedTransformer.java

Last change on this file was 37, checked in by toshi, 14 years ago
File size: 436 bytes
RevLine 
[37]1
2package clustering;
3
4import java.util.List;
5import org.apache.commons.collections15.Transformer;
6
7public class ListSeedTransformer<V> implements Transformer<V,Integer>{
8
9    private List<V> seed_list;
10
11    public ListSeedTransformer(List<V> vertexSeed) {
12        this.seed_list = vertexSeed;
13    }
14
15
16    public Integer transform(V i) {
17        if(seed_list.contains(i))
18            return 1;
19        else
20            return 0;
21    }
22
23}
Note: See TracBrowser for help on using the repository browser.