public AccessState getCurrentState ( ) { if ( AccessState . values ( ) [ currentState . get ( ) ] == AccessState . TOE ) { return AccessState . TOE ; } else { if ( tickRequests . get ( ) <= tackRequests . get ( ) ) { // TODO: looks like this piece of code should be locked :/ tickRequests . set ( 0 ) ; tackRequests . set ( 0 ) ; return AccessState . TACK ; } else return AccessState . TICK ; } }
This method returns the current memory state