Creates an internal state for the given state type.
185736
private AbstractState createState(CopycatServer.State state) {
    switch (state) {
      case INACTIVE:
        return new InactiveState(this);
      case RESERVE:
        return new ReserveState(this);
      case PASSIVE:
        return new PassiveState(this);
      case FOLLOWER:
        return new FollowerState(this);
      case CANDIDATE:
        return new CandidateState(this);
      case LEADER:
        return new LeaderState(this);
      default:
        throw new AssertionError();
    }
  }
282932
def reset_internal_states(self, record=None):
        
        self._record = None
        self._count = 0
        self._record = record
398894
public static <T> void saveInstanceState(@NonNull T target, @NonNull Bundle state) {
        IMPL.saveInstanceState(target, state);
    }
473070
public <T> T get(Class<T> stateType) {
		Map<Class<?>, Object> states = getStates();
		T value = getState( states, stateType );

		if ( value == null ) {
			throw new IllegalArgumentException( "Accessing state of type not enabled: " + stateType );
		}

		return value;
	}
121353
function createInputType(type) {
    return React.createClass({
        displayName: Input.displayName + type,
        render() {
            return <Input {...this.props} type={type.toLowerCase()} />;
        }
    });
}
92732
function pushState(stack, type, instance) {
  stack.type = type;
  stack.children = [];
  stack.instance = instance || stack;
}
1369203
def add_state(self):
        """"""
        sid = len(self.states)
        self.states.append(SFAState(sid))
495789
def add_state(self):
        """"""
        sid = len(self.states)
        self.states.append(DFAState(sid))
        return sid
170139
@Override
  @SuppressWarnings("unchecked")
  public <E> E getState(Class<E> stateType) {
    return stateType == S6aSessionState.class ? (E) this.sessionData.getS6aSessionState() : null;
  }
1045598
public void addState() {
        DiffHistoryDataState nextState = new DiffHistoryDataState(stateEngine, typeDiffInstructions);

        if(currentDataState != null)
            newHistoricalState(currentDataState, nextState);

        currentDataState = nextState;
    }
568953
@SuppressWarnings("unchecked")
    private State create(Class<? extends State> state)
    {
        try
        {
            if (configurer.isPresent())
            {
                final AnimationConfig configAnimations = AnimationConfig.imports(configurer.get());
                final String name = converter.apply(state);
                final Animation animation = configAnimations.getAnimation(name);
                final Class<? extends Feature> feature;
                feature = (Class<? extends Feature>) UtilReflection.getCompatibleConstructor(state,
                                                                                             FeatureProvider.class,
                                                                                             Animation.class)
                                                                   .getParameters()[PARAM_FEATURE_INDEX].getType();
                return UtilReflection.create(state,
                                             UtilReflection.getParamTypes(feature, animation),
                                             getFeature(feature),
                                             animation);
            }
            return UtilReflection.createReduce(state);
        }
        catch (final NoSuchMethodException exception)
        {
            throw new LionEngineException(exception);
        }
    }
31999
def setShowTypeButton(self, state):
        
        self._showTypeButton = state
        if not state:
            self.uiTypeBTN.hide()
        else:
            self.uiTypeBTN.show()
1317801
private synchronized void setState(int state) {
        mState = state;

        // Give the new state to the Handler so the UI Activity can update
        mHandler.obtainMessage(ISOBlueDemo.MESSAGE_STATE_CHANGE, state, -1)
                .sendToTarget();
    }
461452
public function addState(StateInterface $state): self
    {
        $builder = clone $this;
        $builder->states[$state->getName()] = $state;
        return $builder;
    }
1250374
def initialState(self, state):
        

        if self._initialState is not _NO_STATE:
            raise ValueError(
                "initial state already set to {}".format(self._initialState))

        self._initialState = state
263709
public void createTransitionsForState(final Flow flow, final String stateId, final Map<String, String> criteriaAndTargets) {
        if (containsFlowState(flow, stateId)) {
            val state = getState(flow, stateId);
            criteriaAndTargets.forEach((k, v) -> createTransitionForState(state, k, v));
        }
    }
131150
protected function createState(array $state_definition)
    {
        $state_implementor = isset($state_definition['class']) ? $state_definition['class'] : State::CLASS;
        $this->loadStateImplementor($state_implementor);

        $state = $this->service_locator->make(
            $state_implementor,
            [
                ':name' => $state_definition['name'],
                ':type' => $state_definition['type'],
                ':options' => $state_definition['options'],
            ]
        );

        if (!$state instanceof StateInterface) {
            throw new RuntimeError(
                sprintf(
                    'Configured implementor "%s" for state "%s" must implement: %s',
                    $state_implementor,
                    $state_definition['name'],
                    StateInterface::CLASS
                )
            );
        }

        return $state;
    }