Obtain the state that the last transition (the transition with the 'highest' character value)
points to.

@return The to-state of the last transition.
557212
public State lastState() {
        Entry<Character, State> last = transitions.lastEntry();
        if (last == null)
            return null;

        return last.getValue();
    }
1081326
public int last() {
        int val;
        int i;

        for (i = data.length - 1; i >= 0; i--) {
            if (data[i] != 0) {
                val = data[i] >>> 1;
                i <<= SHIFT;
                while (val != 0) {
                    val >>>= 1;
                    i++;
                }
                return i;
            }
        }
        return -1;
    }
1194152
private Transition getShowAnimation(DialogTransition transitionType) {
        Transition animation = null;
        if (contentHolder != null) {
            switch (transitionType) {
                case LEFT:
                    contentHolder.setScaleX(1);
                    contentHolder.setScaleY(1);
                    contentHolder.setTranslateX(-offsetX);
                    animation = new LeftTransition();
                    break;
                case RIGHT:
                    contentHolder.setScaleX(1);
                    contentHolder.setScaleY(1);
                    contentHolder.setTranslateX(offsetX);
                    animation = new RightTransition();
                    break;
                case TOP:
                    contentHolder.setScaleX(1);
                    contentHolder.setScaleY(1);
                    contentHolder.setTranslateY(-offsetY);
                    animation = new TopTransition();
                    break;
                case BOTTOM:
                    contentHolder.setScaleX(1);
                    contentHolder.setScaleY(1);
                    contentHolder.setTranslateY(offsetY);
                    animation = new BottomTransition();
                    break;
                case CENTER:
                    contentHolder.setScaleX(0);
                    contentHolder.setScaleY(0);
                    animation = new CenterTransition();
                    break;
                default:
                    animation = null;
                    contentHolder.setScaleX(1);
                    contentHolder.setScaleY(1);
                    contentHolder.setTranslateX(0);
                    contentHolder.setTranslateY(0);
                    break;
            }
        }
        if (animation != null) {
            animation.setOnFinished(finish ->
                Event.fireEvent(JFXDialog.this, new JFXDialogEvent(JFXDialogEvent.OPENED)));
        }
        return animation;
    }
241760
public String toDot() {
        finalizeDictionary();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("digraph G {\n");

        Map<State, Integer> stateNumbers = numberedStates();

        // We want to traverse states a fixed order, so that the output is predictable. We
        // could also store the numbered states in a TreeMap, but State doesn't implement
        // Comparable, and I wouldn't even know what that would mean ;).
        State[] states = new State[stateNumbers.size()];

        for (Entry<State, Integer> numberedState : stateNumbers.entrySet())
            states[numberedState.getValue()] = numberedState.getKey();

        for (int stateNumber = 0; stateNumber < states.length; ++stateNumber) {
            State s = states[stateNumber];

            if (s.isFinal())
                stringBuilder.append(String.format("%d [peripheries=2];\n", stateNumber));

            for (Entry<Character, State> trans : s.transitions().entrySet())
                stringBuilder.append(String.format("%d -> %d [label=\"%c\"];\n", stateNumber,
                        stateNumbers.get(trans.getValue()), trans.getKey()));
        }

        stringBuilder.append("}");

        return stringBuilder.toString();
    }

    private void addSuffix(State s, CharSequence suffix) {
        for (int i = 0, len = suffix.length(); i < len; i++) {
            State newState = new State();
            s.addTransition(suffix.charAt(i), newState);
            s = newState;
        }

        // s is now a final state.
        s.setFinal(true);
    }

    private Dictionary build(boolean perfectHash, boolean stateSuffixes) {
        finalizeDictionary();

        Map<State, Integer> stateNumbers = numberedStates();
        State[] sList = stateList(stateNumbers);

        int nTransitions = 0;
        for (State aSList : sList) nTransitions += aSList.transitions().size();

        // First compute the offsets of each state in the transition table. Note, we need the width
        // of the number of transitions, since the pointer can be one beyond the last state (if the
        // last state is a final state without transitions).
        CompactIntArray offsets = new CompactIntArray(sList.length, CompactIntArray.width(nTransitions));
        for (int i = 1; i < sList.length; i++)
            offsets.set(i, offsets.get(i - 1) + sList[i - 1].transitions().size());


        // Create transition tables.
        char[] transChars = new char[nTransitions];
        CompactIntArray transTo = new CompactIntArray(nTransitions, CompactIntArray.width(sList.length - 1));

        // Final state set.
        BitSet finalStates = new BitSet();

        // Construct the transition table.
        for (int i = 0; i < sList.length; i++) {
            int j = 0;
            for (Entry<Character, State> trans : sList[i].transitions().entrySet()) {
                transChars[offsets.get(i) + j] = trans.getKey();
                transTo.set(offsets.get(i) + j, stateNumbers.get(trans.getValue()));
                ++j;
            }

            if (sList[i].isFinal())
                finalStates.set(i, true);
        }

        if (perfectHash && stateSuffixes)
            return new PerfectHashDictionaryStateCard(offsets, transChars, transTo, finalStates, d_nSeqs);
        else if (perfectHash)
            return new PerfectHashDictionaryTransCard(offsets, transChars, transTo, finalStates, d_nSeqs);
        else
            return new DictionaryImpl(offsets, transChars, transTo, finalStates, d_nSeqs);
    }

    private Map<State, Integer> numberedStates() {
        Map<State, Integer> states = new HashMap<>();

        Queue<State> stateQueue = new LinkedList<>();
        stateQueue.add(d_startState);
        while (!stateQueue.isEmpty()) {
            State s = stateQueue.poll();

            if (states.containsKey(s))
                continue;

            states.put(s, states.size());

            for (State to : s.transitions().values())
                stateQueue.add(to);
        }

        return states;
    }

    private void replaceOrRegisterIterative(State initial) {
        Deque<State> statePath = new ArrayDeque<>();
        Deque<State> childPath = new ArrayDeque<>();

        State currentState = initial;
        while (currentState.hasOutgoing()) {
            statePath.push(currentState);
            State child = currentState.lastState();
            childPath.push(child);
            currentState = child;
        }

        assert statePath.size() == childPath.size();
        while (!statePath.isEmpty()) {
            State state = statePath.pop();
            State child = childPath.pop();
            replaceOrRegister(state, child);
        }
    }

    private void replaceOrRegister(State state, State child) {
        State replacement = d_register.get(child);
        if (replacement != null)
            state.setLastState(replacement);
        else
            d_register.put(child, child);
    }

    private State[] stateList(Map<State, Integer> numberedStates) {
        State[] r = new State[numberedStates.size()];

        for (Entry<State, Integer> numberedState : numberedStates.entrySet())
            r[numberedState.getValue()] = numberedState.getKey();

        return r;
    }
}
66133
private String getState(int state)
   {
      String st = "";
      switch (state)
      {

         case BackupJob.FINISHED :
            st = "finished";
            break;

         case BackupJob.WORKING :
            st = "working";
            break;

         case BackupJob.WAITING :
            st = "waiting";
            break;

         case BackupJob.STARTING :
            st = "starting";
            break;
         default :
            break;
      }

      return st;
   }
707124
ServerStatus getState() {
        final InternalState requiredState = this.requiredState;
        final InternalState state = internalState;
        if(requiredState == InternalState.FAILED) {
            return ServerStatus.FAILED;
        }
        switch (state) {
            case STOPPED:
                return ServerStatus.STOPPED;
            case SERVER_STARTED:
                return  ServerStatus.STARTED;
            default: {
                if(requiredState == InternalState.SERVER_STARTED) {
                    return ServerStatus.STARTING;
                } else {
                    return ServerStatus.STOPPING;
                }
            }
        }
    }
132074
public Entry getLast()
  {
    if (tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getLast");     
      SibTr.exit(tc, "getLast", last);
    }

    return last;
  }
1208107
public boolean inContentState() {
        return _state.ordinal() >= State.CONTENT.ordinal() && _state.ordinal() < State.END.ordinal();
    }
1307396
public Set<Integer> getTransitions(int state, I input) { // TODO: replace by primitive specialization
        return getTransitions(state, getSymbolIndex(input));
    }
1044709
protected int findTransition(int state, char c) {
        int start = d_stateOffsets.get(state);
        int end = transitionsUpperBound(state) - 1;

        // Binary search
        while (end >= start) {
            int mid = start + ((end - start) / 2);

            if (d_transitionChars[mid] > c)
                end = mid - 1;
            else if (d_transitionChars[mid] < c)
                start = mid + 1;
            else
                return mid;
        }

        return -1;
    }
1331819
protected int transitionsUpperBound(int state) {
        return state + 1 < d_stateOffsets.size() ? d_stateOffsets.get(state + 1) :
                d_transitionChars.length;
    }
1007380
public java.lang.String getState() {
    java.lang.Object ref = state_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        state_ = s;
      }
      return s;
    }
  }
1233033
def transition_to(path, current_state=self.current_state)
      path = path.to_s
      state = current_state || self
      exit_states = []

      # Find the nearest parent state on the path of the current state which
      # has a sub-state at the given path
      new_states = state.find_states(path)
      while(!new_states) do
        exit_states << state
        state = state.parent_state
        raise(StateNotFound, transition_error(path)) unless state
        new_states = state.find_states(path)
      end

      # The first time we enter a state, the state_manager gets entered as well
      new_states.unshift(self) unless has_state?

      # Can only transition to leaf states
      # TODO: transition to the initial_state of the state?
      raise(InvalidTransition, transition_error(path)) unless new_states.last.leaf?

      enter_states = new_states - exit_states
      exit_states = exit_states - new_states

      from_state = current_state
      # TODO: does it make more sense to throw an error instead of allowing
      # a transition to the current state?
      to_state = enter_states.last || from_state

      run_before_callbacks(from_state, to_state, current_event, enter_states, exit_states)

      # Set the state on the underlying resource
      self.current_state = to_state

      run_after_callbacks(from_state, to_state, current_event, enter_states, exit_states)
    end
746184
public int getSimState() {
		TelephonyManager telMgr = (TelephonyManager) context
				.getSystemService(Context.TELEPHONY_SERVICE);
		final int simState = telMgr.getSimState();
		return simState;
	}
1166883
public static String sortAndGetState()
  {
    if (_state.length() == 0) {
      return _state;
    }

    String[] states = _state.split("\\n");
    List<String> list = new ArrayList();
    for (int counter = 0; counter < states.length; ++counter) {
      list.add(states[counter]);
    }

    Collections.sort(list);

    Iterator<String> iterator = list.iterator();
    String value = "";
    while (iterator.hasNext()) {
      value += iterator.next() + "\n";
    }

    _state = "";

    return value;
  }
1082714
public final String getState() {

        String thisMethodName = "getState";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
            SibTr.exit(tc, thisMethodName, states[_state]);
        }

        return states[_state];
    }
605567
protected WidgetState.State getState() {
        final WidgetState.State state;
        if (mIsPressed) {
            state = WidgetState.State.PRESSED;
        } else if (mIsSelected) {
            state = WidgetState.State.SELECTED;
        } else if (mIsFocused) {
            state = WidgetState.State.FOCUSED;
        } else {
            state = WidgetState.State.NORMAL;
        }
        return state;
    }