/*
Looks up the state factory on the owner and sets initial state
on the instance if desired.
509548
function createStateFor(context, stateName, owner) {
  let defaultState = {};
  const StateFactory = owner.factoryFor(`state:${stateName}`);

  if (!StateFactory) {
    return EmberObject.create();
  }

  const StateFactoryClass = StateFactory.class;

  if (typeof StateFactoryClass.initialState === 'function') {
    defaultState = StateFactoryClass.initialState.call(StateFactoryClass, context);
  }
  else if (StateFactoryClass.initialState) {
    throw new TypeError('initialState property must be a function');
  }

  if (EmberObject.detect(StateFactoryClass)) {
    return StateFactoryClass.create(
      owner.ownerInjection(),
      defaultState
    );
  }

  return EmberObject.create(owner.ownerInjection(), StateFactoryClass);
}
757956
public function setStartState($stateId)
    {
        $state = $this->stateMachine->getState(StateMachine::STATE_INITIAL);
        if ($state === null) {
            $state = new InitialState(StateMachine::STATE_INITIAL);
            $this->stateMachine->addState($state);
        }

        $this->addTransition(StateMachine::STATE_INITIAL, $stateId, StateMachine::EVENT_START);
    }
757115
public void init(BaseField owner)
    {
        m_bScreenMove = true;
        m_bInitMove = true;
        m_bReadMove = true;
        super.init(owner);
    }
306442
public void setOwner(ListenerOwner owner)
    {
        if (owner == null)
        {
            this.saveValue(m_recordOwnerCache);
            m_recordOwnerCache = null;
        }
        super.setOwner(owner);
        if (owner != null)
            this.retrieveValue();
    }
1144164
void init(long index, Instant instant, ServerStateMachineContext.Type type) {
    context.update(index, instant, type);
  }
858622
protected void init(int initialMaxSize, Class<T> type, Factory<T> factory) {
		this.size = 0;
		this.type = type;
		this.factory = factory;

		data = (T[]) Array.newInstance(type, initialMaxSize);

		if( factory != null ) {
			for( int i = 0; i < initialMaxSize; i++ ) {
				try {
					data[i] = createInstance();
				} catch( RuntimeException e ) {
					throw new RuntimeException("declareInstances is true, but createInstance() can't create a new instance.  Maybe override createInstance()?");
				}
			}
		}
	}
1364947
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (this.getOwner().getState() == false)
            m_mergeRecord.getTable().removeTable(m_subRecord.getTable()); // If this is off initially, take the table out of the loop
    }
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
429063
protected void setUninitialize()
	{
    	if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
    		logger.logp(Level.FINE, CLASS_NAME,"setUninitialized ","" + this.toString());    

		state = UNINITIALIZED_STATE;
	}
1023969
function State(state) {
    if ( state === void 0 ) state = {};

    Object.defineProperty(this, "_", {
        value: new Subscriber()
    });
    this.update(state);
}
1042798
function(initState) {

    if(!this.isInitialized) {
      this.isInitialized = true;

      var driver = this.driver;

      if(!this.defStates) {

        throw new Error('You must define states before attempting to call init');
      } else if(!this.defTransitions) {

        throw new Error('You must define transitions before attempting to call init');
      } else if(!this.parser) {

        throw new Error('You must define parsers before attempting to call init');
      } else if(!this.defTargets) {

        throw new Error('You must define targets before attempting to call init');
      } else {

        parseStates(driver, this.defStates);
        parseTransitions(driver, this.defStates, this.defTransitions);

        this.parser.init(this.defStates, this.defTargets, this.defTransitions);

        driver.init(initState);
      }

      if(global.__f1__) {
        global.__f1__.init(this);
      } 
    }

    return this;
  }
552918
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
            this.fieldChanged(DBConstants.DONT_DISPLAY, DBConstants.INIT_MOVE);
    }
296861
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        try   {     // Open this table and move to the control record
            if (!this.getOwner().isOpen())
                this.getOwner().open();     // Open the control file
            if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
                this.doNewRecord(true);     // Read the control file
        } catch (DBException e)   {
            return;
        }
    }
852287
function StateMachine(name) {
        var _this = _super.call(this, name, undefined) || this;
        /** Internal flag: false if the state machine model requires recompilation. */
        /** @internal */ _this.clean = false;
        return _this;
    }
988858
function(initialValue, settings) {

		this.value = initialValue;

		this._set = settings.set || this._set;
		this._get = settings.get || this._get;

		// This allows updater to be called without any arguments.
		// selfUpdater flag can be set by things that want to call updater themselves.
		if(!settings.__selfUpdater) {
			var self = this,
				oldUpdater = this.updater;
			this.updater = function() {
				oldUpdater.call(self, self._get(), self.value);
			};
		}


		this._on = settings.on ? settings.on : this._on;
		this._off = settings.off ? settings.off : this._off;
	}
194945
def set_initial_state(self, initial_state, initial_frames):
    """"""
    self.env.set_initial_state(initial_state, initial_frames)
    self._initial_frames = initial_frames
1270149
@SuppressWarnings("unchecked")
	<K, E extends PoolableObject<V>> E releaseOwner() {
		this.owner = null;
		return (E) this;
	}