]> git.uio.no Git - ifi-stolz-refaktor.git/blob - software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/analyze/LongestCommonPrefixAnalyzer.java
Adding command + handler for analyzing projects.
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / src / no / uio / ifi / refaktor / analyze / LongestCommonPrefixAnalyzer.java
1 package no.uio.ifi.refaktor.analyze;
2
3 import no.uio.ifi.refaktor.analyze.collectors.LongestCommonPrefixCollector;
4 import no.uio.ifi.refaktor.analyze.collectors.SelectionValidator;
5 import no.uio.ifi.refaktor.utils.CompilationUnitTextSelection;
6
7 public class LongestCommonPrefixAnalyzer implements Analyzer {
8
9         private final CompilationUnitTextSelection selection;
10         private final LongestCommonPrefixCollector longestCommonPrefixCollector;
11
12         public LongestCommonPrefixAnalyzer(CompilationUnitTextSelection selection) {
13                 this.selection = selection;
14                 longestCommonPrefixCollector = new LongestCommonPrefixCollector(selection);
15         }
16
17         public String stringProperty() {
18                 return longestCommonPrefixCollector.getProperty().toString();
19         }
20
21         @Override
22         public void analyze() {
23                 CollectorManager.collectProperties(selection, longestCommonPrefixCollector);
24         }
25
26         public void checkIfSelectionIsValid() {
27                 SelectionValidator.checkIfSelectionIsValid(selection);
28         }
29 }