Code example for AtomicReference

Methods: getAndSet

0
   * 
   * @return true if the transition is allowed 
   */ 
  private boolean toState(LifecycleState newState)
  { 
    LifecycleState state = _state.getAndSet(newState);
 
    _lastChangeTime = Alarm.getCurrentTime();
 
    if (_log != null && _log.isLoggable(_lowLevel))
      _log.log(_lowLevel, _name + " " + newState);
 
    notifyListeners(state, newState);
 
    return true; 
  } 
 
  // 
  // listeners 
  // 
Contextual code suggestions in your IDE  Get Codota for Java