source:
branches/localSpectral/src/clustering/ListSeedTransformer.java
@
38
Last change on this file since 38 was 37, checked in by , 14 years ago | |
---|---|
File size: 436 bytes |
Line | |
---|---|
1 | |
2 | package clustering; |
3 | |
4 | import java.util.List; |
5 | import org.apache.commons.collections15.Transformer; |
6 | |
7 | public 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.