]>
Commit | Line | Data |
---|---|---|
9a55edb7 EK |
1 | package no.uio.ifi.refaktor.extractors; |
2 | ||
2f82d251 EK |
3 | import java.util.List; |
4 | ||
74581229 EK |
5 | import no.uio.ifi.refaktor.extractors.collectors.LongestCommonPrefixCollector; |
6 | import no.uio.ifi.refaktor.extractors.collectors.PropertyCollector; | |
e0fe6563 | 7 | import no.uio.ifi.refaktor.prefix.Prefix; |
1f62df73 | 8 | import no.uio.ifi.refaktor.utils.DocumentTextSelection; |
9a55edb7 | 9 | |
fe4785f1 EK |
10 | import org.eclipse.jdt.core.ICompilationUnit; |
11 | ||
2f82d251 EK |
12 | public class LongestCommonPrefixExtractor extends PropertyExtractor { |
13 | ||
14 | private LongestCommonPrefixCollector longestCommonPrefixCollector; | |
b9afe13c | 15 | |
1f62df73 | 16 | public LongestCommonPrefixExtractor(DocumentTextSelection selection, ICompilationUnit icu) { |
fe4785f1 | 17 | super(selection, icu); |
2f82d251 | 18 | longestCommonPrefixCollector = new LongestCommonPrefixCollector(selection); |
9a55edb7 | 19 | } |
74581229 EK |
20 | |
21 | @Override | |
22 | protected void registerCollectors(List<PropertyCollector> collectors) { | |
23 | collectors.add(longestCommonPrefixCollector); | |
24 | } | |
3db313c8 EK |
25 | |
26 | public Prefix getProperty() { | |
2f82d251 | 27 | return longestCommonPrefixCollector.getProperty(); |
3db313c8 | 28 | } |
e08cc2c6 EK |
29 | |
30 | public String stringProperty() { | |
2f82d251 EK |
31 | return longestCommonPrefixCollector.getProperty().toString(); |
32 | } | |
9a55edb7 | 33 | } |