Add a transition to the transition table.

@param table - table to add transition
@param {number} inp - input character code
@param {number} state - current state
@param {number=} action - action to be taken
@param {number=} next - next state
186104
function add(table, inp, state, action, next) {
        table[state<<8|inp] = ((action | 0) << 4) | ((next === undefined) ? state : next);
    }
954210
public void addCondition( Condition condition, String transitionName ){
        conditions.add( Pair.of( condition, transitionName ) );
    }
1128915
public void transition(CopycatServer.State state) {
    checkThread();

    if (this.state != null && state == this.state.type()) {
      return;
    }

    LOGGER.info("{} - Transitioning to {}", cluster.member().address(), state);

    // Close the old state.
    try {
      this.state.close().get();
    } catch (InterruptedException | ExecutionException e) {
      throw new IllegalStateException("failed to close Raft state", e);
    }

    // Force state transitions to occur synchronously in order to prevent race conditions.
    try {
      this.state = createState(state);
      this.state.open().get();
    } catch (InterruptedException | ExecutionException e) {
      throw new IllegalStateException("failed to initialize Raft state", e);
    }

    stateChangeListeners.forEach(l -> l.accept(this.state.type()));
  }
329407
def transitions(object, action, options = {})
      transitions = map do |name, machine|
        machine.events.attribute_transition_for(object, true) if machine.action == action
      end

      AttributeTransitionCollection.new(transitions.compact, {use_transactions: resolve_use_transactions}.merge(options))
    end
846197
@Override
  public void onTableProcessBegin(Table table, long tableProcessTime) {

    Preconditions.checkNotNull(table);

    if (!this.expectedHighWatermarks.hasPartitionWatermarks(tableKey(table))) {
      this.expectedHighWatermarks.setPartitionWatermarks(tableKey(table), Maps.<String, Long> newHashMap());
    }
  }
428373
function eventTap ( event ) {

            // The tap event shouldn't propagate up
            event.stopPropagation();

            var proposal = calcPointToPercentage(event.calcPoint);
            var handleNumber = getClosestHandle(proposal);

            // Tackle the case that all handles are 'disabled'.
            if ( handleNumber === false ) {
                return false;
            }

            // Flag the slider as it is now in a transitional state.
            // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.
            if ( !options.events.snap ) {
                addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);
            }

            setHandle(handleNumber, proposal, true, true);

            setZindex();

            fireEvent('slide', handleNumber, true);
            fireEvent('set', handleNumber, true);
            fireEvent('change', handleNumber, true);
            fireEvent('update', handleNumber, true);

            if ( options.events.snap ) {
                eventStart(event, { handleNumbers: [handleNumber] });
            }
        }
698494
private void pushState(int indentation) {
        states.push(state);
        state = new StreamStatus();
        state.setIndentationLevel(indentation);
    }
735753
function(data, event) {
        var extraArgs = _.toArray(arguments).slice(2),
        leaveState = this.currentState,
        enterState = data.enterState,
        triggers = data.triggers

        if (!this.silent)
          this.trigger.apply(this, ['leaveState:' + leaveState].concat(extraArgs))
        this._callCallbacks(this._states[leaveState].leave, extraArgs)

        if (!this.silent) {
          this.trigger.apply(this, ['transition', leaveState, enterState].concat(extraArgs))
          if (triggers)
            this.trigger.apply(this, [triggers].concat(extraArgs))
        }

        this._callCallbacks(data.callbacks, extraArgs)
        if (!this.silent)
          this.trigger.apply(this, ['enterState:' + enterState].concat(extraArgs))

        this.toState.apply(this, [enterState].concat(extraArgs))
      }
212244
function transition() {
    var ts = this.__transitions__, i, len;

    if (!ts || ts.length === 0) { return; }

    for (i = 0, len = ts.length; i < len; i++) {
      enter.call(ts[i].pivot, ts[i].states, ts[i].opts);
    }

    this.__transitions__ = [];
  }
882195
function addTableDefinition(tableDefinitions, tableDefinition) {
    Validate.isObject(tableDefinitions);
    Validate.notNull(tableDefinitions);
    validateTableDefinition(tableDefinition);

    tableDefinitions[tableDefinition.name.toLowerCase()] = tableDefinition;
}
291011
def enter!
      @state_machine.current_state = self

      @entry_actions.each do |entry_action|
        entry_action.call(@state_machine)
      end
      @transition_map.each do |type, events_to_transition_arrays|
        events_to_transition_arrays.each do |event, transitions|
          transitions.each(&:arm)
        end
      end
    end
1121046
public void createStateDefaultTransition(final TransitionableState state, final String targetState) {
        if (state == null) {
            LOGGER.trace("Cannot add default transition of [{}] to the given state is null and cannot be found in the flow.", targetState);
            return;
        }
        val transition = createTransition(targetState);
        state.getTransitionSet().add(transition);
    }
220910
public void changeState(Class<? extends State> next)
    {
        Check.notNull(next);

        final State from = current;
        if (current != null)
        {
            last = current.getClass();
            current.exit();
        }
        if (!states.containsKey(next))
        {
            final State state = create(next);
            states.put(next, state);
        }
        current = states.get(next);
        current.enter();

        listeners.forEach(l -> l.notifyStateTransition(from != null ? from.getClass() : null, next));
    }
1355675
public StateMachine<T> next(T nextState) throws IllegalStateException {
        Set<T> allowed = transitions.get(currentState);
        checkNotNull(allowed, "No transitions from state " + currentState);
        checkState(allowed.contains(nextState), "Transition not allowed from state " + currentState + " to " + nextState);
        currentState = nextState;
        return this;
    }
1341468
protected void transition(Member.Type type) {
    switch (type) {
      case ACTIVE:
        if (!(state instanceof ActiveState)) {
          transition(CopycatServer.State.FOLLOWER);
        }
        break;
      case PASSIVE:
        if (this.state.type() != CopycatServer.State.PASSIVE) {
          transition(CopycatServer.State.PASSIVE);
        }
        break;
      case RESERVE:
        if (this.state.type() != CopycatServer.State.RESERVE) {
          transition(CopycatServer.State.RESERVE);
        }
        break;
      default:
        if (this.state.type() != CopycatServer.State.INACTIVE) {
          transition(CopycatServer.State.INACTIVE);
        }
        break;
    }
  }
760809
def add_actions
      # Checks whether the event can be fired on the current object
      machine.define_helper(:instance, "can_#{qualified_name}?") do |machine, object, *args|
        machine.event(name).can_fire?(object, *args)
      end

      # Gets the next transition that would be performed if the event were
      # fired now
      machine.define_helper(:instance, "#{qualified_name}_transition") do |machine, object, *args|
        machine.event(name).transition_for(object, *args)
      end

      # Fires the event
      machine.define_helper(:instance, qualified_name) do |machine, object, *args|
        machine.event(name).fire(object, *args)
      end

      # Fires the event, raising an exception if it fails
      machine.define_helper(:instance, "#{qualified_name}!") do |machine, object, *args|
        object.send(qualified_name, *args) || raise(StateMachines::InvalidTransition.new(object, machine, name))
      end
    end
1037992
public function switchTable($table=null)
	{
		static $tTable;
		if(null===$table)
		{
			if(null!==$tTable)
			{
				$this->table=$tTable;
				$tTable=null;
			}
		}
		else
		{
			$tTable=$this->table;
			$this->table=$table;
		}
		$this->loadFields($this->fields, $this->fieldNames, $this->pk, $this->bitFields);
	}