source:
branches/localSpectral/src/clustering/SeedTransformer.java
Last change on this file was 27, checked in by , 14 years ago | |
---|---|
File size: 385 bytes |
Line | |
---|---|
1 | |
2 | package clustering; |
3 | |
4 | import org.apache.commons.collections15.Transformer; |
5 | |
6 | public class SeedTransformer<V> implements Transformer{ |
7 | |
8 | private V seed; |
9 | |
10 | public SeedTransformer(V vertexSeed) { |
11 | this.seed = vertexSeed; |
12 | } |
13 | |
14 | public Object transform(Object vertex) { |
15 | if (seed.equals(vertex)) |
16 | return 1.0; |
17 | else |
18 | return 0.0; |
19 | |
20 | } |
21 | |
22 | } |
Note: See TracBrowser
for help on using the repository browser.