package no.uio.ifi.refaktor.analyze.analyzers; import no.uio.ifi.refaktor.analyze.CollectorManager; import no.uio.ifi.refaktor.analyze.collectors.LongestCommonPrefixCollector; import no.uio.ifi.refaktor.analyze.collectors.SelectionValidator; import no.uio.ifi.refaktor.utils.CompilationUnitTextSelection; public class LongestCommonPrefixAnalyzer implements Analyzer { private final CompilationUnitTextSelection selection; private final LongestCommonPrefixCollector longestCommonPrefixCollector; public LongestCommonPrefixAnalyzer(CompilationUnitTextSelection selection) { this.selection = selection; longestCommonPrefixCollector = new LongestCommonPrefixCollector(selection); } public String stringProperty() { return longestCommonPrefixCollector.getProperty().toString(); } @Override public void analyze() { CollectorManager.collectProperties(selection, longestCommonPrefixCollector); } public void checkIfSelectionIsValid() { SelectionValidator.checkIfSelectionIsValid(selection); } }