public abstract class AbstractTreeHasher extends java.lang.Object implements TreeHasher
Modifier and Type | Field and Description |
---|---|
protected FragmentsCollector |
myCallBack |
protected boolean |
myForIndexing |
Constructor and Description |
---|
AbstractTreeHasher(FragmentsCollector cb,
boolean forIndexing) |
Modifier and Type | Method and Description |
---|---|
protected TreePsiFragment |
buildFragment(NodeSpecificHasher hasher,
java.util.List<? extends PsiElement> elements,
int from,
int to) |
protected TreePsiFragment |
buildFragment(NodeSpecificHasher hasher,
PsiElement root,
int cost) |
protected TreeHashResult |
computeElementHash(PsiElement root,
PsiFragment upper,
NodeSpecificHasher hasher)
Computes element hash using children hashes.
|
protected int |
getCost(PsiElement root) |
protected abstract int |
getDiscardCost(PsiElement root) |
void |
hash(PsiElement root,
NodeSpecificHasher hasher) |
protected abstract TreeHashResult |
hash(PsiElement root,
PsiFragment upper,
NodeSpecificHasher hasher) |
protected TreeHashResult |
hashCodeBlock(java.util.List<? extends PsiElement> statements,
PsiFragment upper,
NodeSpecificHasher hasher) |
protected TreeHashResult |
hashCodeBlock(java.util.List<? extends PsiElement> statements,
PsiFragment upper,
NodeSpecificHasher hasher,
boolean forceHash)
Creates PsiFragments using given statements with their hashes
|
protected boolean |
ignoreChildHash(PsiElement element) |
boolean |
shouldAnonymize(PsiElement root,
NodeSpecificHasher hasher) |
static int |
vector(int[] args) |
static int |
vector(int[] args,
int mult) |
protected final boolean myForIndexing
protected final FragmentsCollector myCallBack
public AbstractTreeHasher(FragmentsCollector cb, boolean forIndexing)
public final void hash(PsiElement root, NodeSpecificHasher hasher)
hash
in interface TreeHasher
protected abstract TreeHashResult hash(PsiElement root, PsiFragment upper, NodeSpecificHasher hasher)
protected TreeHashResult computeElementHash(PsiElement root, PsiFragment upper, NodeSpecificHasher hasher)
protected TreePsiFragment buildFragment(NodeSpecificHasher hasher, PsiElement root, int cost)
protected TreePsiFragment buildFragment(NodeSpecificHasher hasher, java.util.List<? extends PsiElement> elements, int from, int to)
protected abstract int getDiscardCost(PsiElement root)
protected boolean ignoreChildHash(PsiElement element)
protected TreeHashResult hashCodeBlock(java.util.List<? extends PsiElement> statements, PsiFragment upper, NodeSpecificHasher hasher)
protected TreeHashResult hashCodeBlock(java.util.List<? extends PsiElement> statements, PsiFragment upper, NodeSpecificHasher hasher, boolean forceHash)
protected int getCost(PsiElement root)
public static int vector(int[] args)
public static int vector(int[] args, int mult)
public boolean shouldAnonymize(PsiElement root, NodeSpecificHasher hasher)