Top Constructors Methods
com.github.javaparser.printer.lexicalpreservation

pack-priv Class DifferenceElementCalculator

extends Object
Class Inheritance
Imports
com.github.javaparser.ast.Node, com.github.javaparser.ast.body.VariableDeclarator, com.github.javaparser.ast.type.Type, com.github.javaparser.printer.concretesyntaxmodel.*, com.github.javaparser.printer.lexicalpreservation.LexicalDifferenceCalculator.CsmChild, java.util.*

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static List<DifferenceElement>
calculate(LexicalDifferenceCalculator.CalculatedSyntaxModel original, LexicalDifferenceCalculator.CalculatedSyntaxModel after)

Calculate the Difference between two CalculatedSyntaxModel elements, determining which elements were kept, which were added and which were removed.

private static List<DifferenceElement>
private static void
considerRemoval(NodeText nodeTextForChild, List<DifferenceElement> elements)

private static int
considerRemoval(CsmElement removedElement, int originalIndex, List<DifferenceElement> elements)

private static long
private static Map<Node, Integer>
findChildrenPositions(LexicalDifferenceCalculator.CalculatedSyntaxModel calculatedSyntaxModel)

Find the positions of all the given children.

pack-priv static boolean
pack-priv static void
removeIndentationElements(List<DifferenceElement> elements)

Remove from the difference all the elements related to indentation.

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DifferenceElementCalculatorback to summary
pack-priv DifferenceElementCalculator()

Method Detail

calculateback to summary
pack-priv static List<DifferenceElement> calculate(LexicalDifferenceCalculator.CalculatedSyntaxModel original, LexicalDifferenceCalculator.CalculatedSyntaxModel after)

Calculate the Difference between two CalculatedSyntaxModel elements, determining which elements were kept, which were added and which were removed.

calculateImplback to summary
private static List<DifferenceElement> calculateImpl(LexicalDifferenceCalculator.CalculatedSyntaxModel original, LexicalDifferenceCalculator.CalculatedSyntaxModel after)
considerRemovalback to summary
private static void considerRemoval(NodeText nodeTextForChild, List<DifferenceElement> elements)
considerRemovalback to summary
private static int considerRemoval(CsmElement removedElement, int originalIndex, List<DifferenceElement> elements)
costback to summary
private static long cost(List<DifferenceElement> elements)
findChildrenPositionsback to summary
private static Map<Node, Integer> findChildrenPositions(LexicalDifferenceCalculator.CalculatedSyntaxModel calculatedSyntaxModel)

Find the positions of all the given children.

matchingback to summary
pack-priv static boolean matching(CsmElement a, CsmElement b)
removeIndentationElementsback to summary
pack-priv static void removeIndentationElements(List<DifferenceElement> elements)

Remove from the difference all the elements related to indentation. This is mainly intended for test purposes.

replacementback to summary
private static boolean replacement(CsmElement a, CsmElement b)