1 package no.uio.ifi.refaktor.analyze.analyzers;
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;
8 public class LongestCommonPrefixAnalyzer implements Analyzer {
10 private final CompilationUnitTextSelection selection;
11 private final LongestCommonPrefixCollector longestCommonPrefixCollector;
13 public LongestCommonPrefixAnalyzer(CompilationUnitTextSelection selection) {
14 this.selection = selection;
15 longestCommonPrefixCollector = new LongestCommonPrefixCollector(selection);
18 public String stringProperty() {
19 return longestCommonPrefixCollector.getProperty().toString();
23 public void analyze() throws RefaktorAnalyzerException {
24 CollectorManager.collectProperties(selection, longestCommonPrefixCollector);
27 public void checkIfSelectionIsValid() {
28 SelectionValidator.checkIfSelectionIsValid(selection);