stateDiagram-v2%% 关键语法state if_state <<choice>>[*]-->IsPositiveIsPositive-->if_stateif_state-->False:if n < 0if_state-->True:if n >= 0False-->[*]True-->[*]
stateDiagram-v2%% 关键语法state if_state <<choice>>[*]-->IsPositiveIsPositive-->if_stateif_state-->False:if n < 0if_state-->True:if n >= 0False-->[*]True-->[*]
stateDiagram-v2 State1: The state with a note%% 多行备注note right ofState1 Important information! You can write break line notes.end noteState1-->State2%% 单行备注note left ofState2:note left
stateDiagram-v2 State1: The state with a note%% 多行备注note right ofState1 Important information! You can write break line notes.end noteState1-->State2%% 单行备注note left ofState2:note left
stateDiagram-v2[*]-->Runnable:start()Runnable-->Running:cpu scheduleRunning-->Runnable:cpu schedule bwp: Blocked in object's wait pool blp: Blocked in object's lock poolRunning-->bwp:wait() must have lockbwp-->blp:notify()/interrupt()blp-->Runnable:acquires lockRunning-->blp:synchronizedRunning-->Block:block eventBlock-->Runnable:block event endRunning-->[*]:run() complete
stateDiagram-v2[*]-->Runnable:start()Runnable-->Running:cpu scheduleRunning-->Runnable:cpu schedule bwp: Blocked in object's wait pool blp: Blocked in object's lock poolRunning-->bwp:wait() must have lockbwp-->blp:notify()/interrupt()blp-->Runnable:acquires lockRunning-->blp:synchronizedRunning-->Block:block eventBlock-->Runnable:block event endRunning-->[*]:run() complete