org.sonar.duplications.detector.suffixtree
Class DuplicationsCollector

java.lang.Object
  extended by org.sonar.duplications.detector.suffixtree.Search.Collector
      extended by org.sonar.duplications.detector.suffixtree.DuplicationsCollector

public class DuplicationsCollector
extends Search.Collector

Implementation of Search.Collector, which constructs CloneGroups.


Constructor Summary
DuplicationsCollector(TextSet text)
           
 
Method Summary
 void endOfGroup()
          Constructs CloneGroup and saves it.
 List<CloneGroup> getResult()
           
 void part(int start, int end)
          Constructs ClonePart and saves it for future processing in endOfGroup().
 void startOfGroup(int size, int length)
          Invoked at the beginning of processing for current node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuplicationsCollector

public DuplicationsCollector(TextSet text)
Method Detail

getResult

public List<CloneGroup> getResult()
Returns:
current result

startOfGroup

public void startOfGroup(int size,
                         int length)
Description copied from class: Search.Collector
Invoked at the beginning of processing for current node.

Length - is a depth of node. And nodes are visited in descending order of depth, thus we guaranty that length will not increase between two sequential calls of this method (can be equal or less than previous value).

Parameters:
size - number of parts in group
length - length of each part in group

part

public void part(int start,
                 int end)
Constructs ClonePart and saves it for future processing in endOfGroup().

Parameters:
start - number of first block from text for this part
end - number of last block from text for this part
len - number of blocks in this part

endOfGroup

public void endOfGroup()
Constructs CloneGroup and saves it.



Copyright © 2009-2012 SonarSource. All Rights Reserved.