]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | package no.uio.ifi.refaktor.analyze.analyzers; |
2 | ||
3 | import no.uio.ifi.refaktor.analyze.CollectorManager; | |
4 | import no.uio.ifi.refaktor.analyze.collectors.LongestCommonPrefixCollector; | |
5 | import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException; | |
6 | import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection; | |
7 | ||
8 | public class LongestCommonPrefixAnalyzer implements Analyzer { | |
9 | ||
10 | private final CompilationUnitTextSelection selection; | |
11 | private final LongestCommonPrefixCollector longestCommonPrefixCollector; | |
12 | ||
13 | public LongestCommonPrefixAnalyzer(CompilationUnitTextSelection selection) { | |
14 | this.selection = selection; | |
15 | longestCommonPrefixCollector = new LongestCommonPrefixCollector(selection); | |
16 | } | |
17 | ||
18 | public String stringProperty() { | |
19 | return longestCommonPrefixCollector.getProperty().toString(); | |
20 | } | |
21 | ||
22 | @Override | |
23 | public void analyze() throws RefaktorAnalyzerException { | |
24 | CollectorManager.collectProperties(selection, longestCommonPrefixCollector); | |
25 | } | |
26 | ||
27 | public void checkIfSelectionIsValid() { | |
28 | SelectionValidator.checkIfSelectionIsValid(selection); | |
29 | } | |
30 | } |