/** * The hash code is only a function of the {@link ATNState#stateNumber} * and {@link ATNConfig#context}. */ @Override public int hashCode(ATNConfig o) { int hashCode = MurmurHash.initialize(7); hashCode = MurmurHash.update(hashCode, o.state.stateNumber); hashCode = MurmurHash.update(hashCode, o.context); hashCode = MurmurHash.finish(hashCode, 2); return hashCode; }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, AND.class.hashCode()); }
protected static int calculateEmptyHashCode() { int hash = MurmurHash.initialize(INITIAL_HASH); hash = MurmurHash.finish(hash, 0); return hash; }
/** * Initialize the hash using the default seed value. * * @return the intermediate hash value */ public static int initialize() { return initialize(DEFAULT_SEED); }
/** * Update the intermediate hash value for the next input {@code value}. * * @param hash the intermediate hash value * @param value the value to add to the current hash * @return the updated intermediate hash value */ public static int update(int hash, Object value) { return update(hash, value != null ? value.hashCode() : 0); }
protected static int calculateEmptyHashCode() { int hash = MurmurHash.initialize(INITIAL_HASH); hash = MurmurHash.finish(hash, 0); return hash; }
/** * Initialize the hash using the default seed value. * * @return the intermediate hash value */ public static int initialize() { return initialize(DEFAULT_SEED); }
/** * Update the intermediate hash value for the next input {@code value}. * * @param hash the intermediate hash value * @param value the value to add to the current hash * @return the updated intermediate hash value */ public static int update(int hash, Object value) { return update(hash, value != null ? value.hashCode() : 0); }
/** * Constructs an executor for a sequence of {@link LexerAction} actions. * @param lexerActions The lexer actions to execute. */ public LexerActionExecutor(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); }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, OR.class.hashCode()); }
@Override public int hashCode() { int hashCode = MurmurHash.initialize(7); hashCode = MurmurHash.update(hashCode, state.stateNumber); hashCode = MurmurHash.update(hashCode, alt); hashCode = MurmurHash.update(hashCode, context); hashCode = MurmurHash.update(hashCode, semanticContext); hashCode = MurmurHash.finish(hashCode, 4); return hashCode; }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, OR.class.hashCode()); }
@Override public int hashCode() { int hashCode = MurmurHash.initialize(7); hashCode = MurmurHash.update(hashCode, state.stateNumber); hashCode = MurmurHash.update(hashCode, alt); hashCode = MurmurHash.update(hashCode, context); hashCode = MurmurHash.update(hashCode, semanticContext); hashCode = MurmurHash.update(hashCode, passedThroughNonGreedyDecision ? 1 : 0); hashCode = MurmurHash.update(hashCode, lexerActionExecutor); hashCode = MurmurHash.finish(hashCode, 6); return hashCode; }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, AND.class.hashCode()); }
@Override public int hashCode() { int hash = MurmurHash.initialize(); hash = MurmurHash.update(hash, a); hash = MurmurHash.update(hash, b); return MurmurHash.finish(hash, 2); }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, AND.class.hashCode()); }
@Override public int hashCode() { int hashCode = MurmurHash.initialize(); hashCode = MurmurHash.update(hashCode, ruleIndex); hashCode = MurmurHash.update(hashCode, predIndex); hashCode = MurmurHash.update(hashCode, isCtxDependent ? 1 : 0); hashCode = MurmurHash.finish(hashCode, 3); return hashCode; }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, AND.class.hashCode()); }
@Override public int hashCode() { int hash = MurmurHash.initialize(); hash = MurmurHash.update(hash, offset); hash = MurmurHash.update(hash, action); return MurmurHash.finish(hash, 2); }
@Override public int hashCode() { return MurmurHash.hashCode(opnds, AND.class.hashCode()); }