Example usage for org.eclipse.jdt.internal.core.search.matching PatternLocator ACCURATE_MATCH

List of usage examples for org.eclipse.jdt.internal.core.search.matching PatternLocator ACCURATE_MATCH

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.search.matching PatternLocator ACCURATE_MATCH.

Prototype

int ACCURATE_MATCH

To view the source code for org.eclipse.jdt.internal.core.search.matching PatternLocator ACCURATE_MATCH.

Click Source Link

Usage

From source file:org.eclipse.che.jdt.internal.core.search.matching.MatchingNodeSet.java

License:Open Source License

public int addMatch(ASTNode node, int matchLevel) {
    int maskedLevel = matchLevel
            & org.eclipse.jdt.internal.core.search.matching.PatternLocator.MATCH_LEVEL_MASK;
    switch (maskedLevel) {
    case org.eclipse.jdt.internal.core.search.matching.PatternLocator.INACCURATE_MATCH:
        if (matchLevel != maskedLevel) {
            addTrustedMatch(node, new Integer(SearchMatch.A_INACCURATE + (matchLevel
                    & org.eclipse.jdt.internal.core.search.matching.PatternLocator.FLAVORS_MASK)));
        } else {/*from ww w .  j  a va2s .  com*/
            addTrustedMatch(node, POTENTIAL_MATCH);
        }
        break;
    case org.eclipse.jdt.internal.core.search.matching.PatternLocator.POSSIBLE_MATCH:
        addPossibleMatch(node);
        break;
    case org.eclipse.jdt.internal.core.search.matching.PatternLocator.ERASURE_MATCH:
        if (matchLevel != maskedLevel) {
            addTrustedMatch(node, new Integer(SearchPattern.R_ERASURE_MATCH + (matchLevel
                    & org.eclipse.jdt.internal.core.search.matching.PatternLocator.FLAVORS_MASK)));
        } else {
            addTrustedMatch(node, ERASURE_MATCH);
        }
        break;
    case org.eclipse.jdt.internal.core.search.matching.PatternLocator.ACCURATE_MATCH:
        if (matchLevel != maskedLevel) {
            addTrustedMatch(node,
                    new Integer(SearchMatch.A_ACCURATE + (matchLevel & PatternLocator.FLAVORS_MASK)));
        } else {
            addTrustedMatch(node, EXACT_MATCH);
        }
        break;
    }
    return matchLevel;
}

From source file:org.eclipse.objectteams.otdt.internal.core.search.matching.ReferenceToTeamPackagePattern.java

License:Open Source License

public int matches(ImportReference importRef) {
    // note: _roleName is not compared at this stage, deferred to handling by the ReferenceToTeamLocator
    if (matchesName(this.teamQualifiedName, CharOperation.concatWith(importRef.tokens, '.')))
        return PatternLocator.ACCURATE_MATCH;
    return PatternLocator.IMPOSSIBLE_MATCH;
}