Java 类org.antlr.v4.runtime.misc.MurmurHash 实例源码

项目:codebuff    文件:FeatureVectorAsObject.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    int n = 0;
    for (int i = 0; i<features.length-3; i++) { // don't include INFO
        if ( featureMetaData!=null && featureMetaData[i]==FeatureMetaData.UNUSED ) continue;
        n++;
        int feature = features[i];
        hash = MurmurHash.update(hash, feature);
    }
    return MurmurHash.finish(hash, n);
}
项目:codebuff    文件:Quad.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, a);
    hash = MurmurHash.update(hash, b);
    hash = MurmurHash.update(hash, c);
    hash = MurmurHash.update(hash, d);
    return MurmurHash.finish(hash, 4);
}
项目:codebuff    文件:ParentSiblingListKey.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, parentRuleIndex);
    hash = MurmurHash.update(hash, parentRuleAlt);
    hash = MurmurHash.update(hash, childRuleIndex);
    hash = MurmurHash.update(hash, childRuleAlt);
    hash = MurmurHash.update(hash, separatorTokenType);
    return MurmurHash.finish(hash, 5);
}
项目:codebuff    文件:RuleAltKey.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, ruleName);
    hash = MurmurHash.update(hash, altNum);
    return MurmurHash.finish(hash, 2);
}
项目:codebuff    文件:ContextGetterDecl.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, name);
    hash = MurmurHash.update(hash, getArgType());
    hash = MurmurHash.finish(hash, 2);
    return hash;
}
项目:Scratch-ApuC    文件:DFAState.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize(7);
    hash = MurmurHash.update(hash, configs.hashCode());
    hash = MurmurHash.finish(hash, 1);
    return hash;
}
项目:Scratch-ApuC    文件:LexerIndexedCustomAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, offset);
    hash = MurmurHash.update(hash, action);
    return MurmurHash.finish(hash, 2);
}
项目:Scratch-ApuC    文件:LexerChannelAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    hash = MurmurHash.update(hash, channel);
    return MurmurHash.finish(hash, 2);
}
项目:Scratch-ApuC    文件:LexerTypeAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    hash = MurmurHash.update(hash, type);
    return MurmurHash.finish(hash, 2);
}
项目:Scratch-ApuC    文件:PredictionContext.java   
protected static int calculateHashCode(PredictionContext parent, int returnState) {
    int hash = MurmurHash.initialize(INITIAL_HASH);
    hash = MurmurHash.update(hash, parent);
    hash = MurmurHash.update(hash, returnState);
    hash = MurmurHash.finish(hash, 2);
    return hash;
}
项目:Scratch-ApuC    文件:PredictionContext.java   
protected static int calculateHashCode(PredictionContext[] parents, int[] returnStates) {
    int hash = MurmurHash.initialize(INITIAL_HASH);

    for (PredictionContext parent : parents) {
        hash = MurmurHash.update(hash, parent);
    }

    for (int returnState : returnStates) {
        hash = MurmurHash.update(hash, returnState);
    }

    hash = MurmurHash.finish(hash, 2 * parents.length);
    return hash;
}
项目:Scratch-ApuC    文件:LexerCustomAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    hash = MurmurHash.update(hash, ruleIndex);
    hash = MurmurHash.update(hash, actionIndex);
    return MurmurHash.finish(hash, 3);
}
项目:Scratch-ApuC    文件:LexerActionExecutor.java   
/**
 * Constructs an executor for a sequence of {@link LexerAction} actions.
 * @param lexerActions The lexer actions to execute.
 */
public LexerActionExecutor(@NotNull LexerAction[] lexerActions) {
    this.lexerActions = lexerActions;

    int hash = MurmurHash.initialize();
    for (LexerAction lexerAction : lexerActions) {
        hash = MurmurHash.update(hash, lexerAction);
    }

    this.hashCode = MurmurHash.finish(hash, lexerActions.length);
}
项目:Scratch-ApuC    文件:LexerModeAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    hash = MurmurHash.update(hash, mode);
    return MurmurHash.finish(hash, 2);
}
项目:Scratch-ApuC    文件:LexerPushModeAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    hash = MurmurHash.update(hash, mode);
    return MurmurHash.finish(hash, 2);
}
项目:intellij-plugin-v4    文件:ANTLRv4LexerState.java   
@Override
protected int hashCodeImpl() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getMode());
    hash = MurmurHash.update(hash, getModeStack());
    hash = MurmurHash.update(hash, getCurrentRuleType());
    return MurmurHash.finish(hash, 3);
}
项目:jetbrains    文件:ANTLRLexerState.java   
protected int hashCodeImpl() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, mode);
    hash = MurmurHash.update(hash, modeStack);
    return MurmurHash.finish(hash, 2);
}
项目:Scratch-ApuC    文件:LexerSkipAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    return MurmurHash.finish(hash, 1);
}
项目:Scratch-ApuC    文件:PredictionContext.java   
protected static int calculateEmptyHashCode() {
    int hash = MurmurHash.initialize(INITIAL_HASH);
    hash = MurmurHash.finish(hash, 0);
    return hash;
}
项目:Scratch-ApuC    文件:LexerPopModeAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    return MurmurHash.finish(hash, 1);
}
项目:Scratch-ApuC    文件:SemanticContext.java   
@Override
public int hashCode() {
    return MurmurHash.hashCode(opnds, AND.class.hashCode());
}
项目:Scratch-ApuC    文件:SemanticContext.java   
@Override
public int hashCode() {
    return MurmurHash.hashCode(opnds, OR.class.hashCode());
}
项目:Scratch-ApuC    文件:LexerMoreAction.java   
@Override
public int hashCode() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, getActionType().ordinal());
    return MurmurHash.finish(hash, 1);
}
项目:intellij-plugin-v4    文件:ANTLRLexerState.java   
protected int hashCodeImpl() {
    int hash = MurmurHash.initialize();
    hash = MurmurHash.update(hash, mode);
    hash = MurmurHash.update(hash, modeStack);
    return MurmurHash.finish(hash, 2);
}