/** * Saves CloneGroup, if it is not included into previously saved. * <p> * Current CloneGroup can not include none of CloneGroup, which were constructed before. * Proof: * According to an order of visiting nodes in suffix tree - length of earlier >= length of current. * If length of earlier > length of current, then earlier not contained in current. * If length of earlier = length of current, then earlier can be contained in current only * when current has exactly the same and maybe some additional CloneParts as earlier, * what in his turn will mean that two inner-nodes on same depth will satisfy condition * current.startSize <= earlier.startSize <= earlier.endSize <= current.endSize , which is not possible for different inner-nodes on same depth. * </p> * Thus this method checks only that none of CloneGroup, which was constructed before, does not include current CloneGroup. */ private void filter(CloneGroup current) { for (CloneGroup earlier : filtered) { if (containsIn(current, earlier)) { return; } } filtered.add(current); }
/** * Saves CloneGroup, if it is not included into previously saved. * <p> * Current CloneGroup can not include none of CloneGroup, which were constructed before. * Proof: * According to an order of visiting nodes in suffix tree - length of earlier >= length of current. * If length of earlier > length of current, then earlier not contained in current. * If length of earlier = length of current, then earlier can be contained in current only * when current has exactly the same and maybe some additional CloneParts as earlier, * what in his turn will mean that two inner-nodes on same depth will satisfy condition * current.startSize <= earlier.startSize <= earlier.endSize <= current.endSize , which is not possible for different inner-nodes on same depth. * </p> * Thus this method checks only that none of CloneGroup, which was constructed before, does not include current CloneGroup. */ private void filter(CloneGroup current) { for (CloneGroup earlier : filtered) { if (containsIn(current, earlier)) { return; } } filtered.add(current); }