protected Flow flow() { if (!dirty) { // optimization in case this method is called consecutively return flow; } flow = new SimpleFlow(name); // optimization for flows that only have one state that itself is a flow: if (currentState instanceof FlowState && states.size() == 1) { return ((FlowState) currentState).getFlows().iterator().next(); } addDanglingEndStates(); flow.setStateTransitions(transitions); dirty = false; return flow; }
protected Flow flow() { if (!dirty) { // optimization in case this method is called consecutively return flow; } flow = new SimpleFlow(name); // optimization for flows that only have one state that itself is a flow: if (currentState instanceof FlowState && states.size() == 1) { return ((FlowState) currentState).getFlows().iterator().next(); } addDanglingEndStates(); flow.setStateTransitions(transitions); dirty = false; return flow; }
protected Flow flow() { if (!dirty) { // optimization in case this method is called consecutively return flow; } flow = new SimpleFlow(name); // optimization for flows that only have one state that itself is a flow: if (currentState instanceof FlowState && states.size() == 1) { return ((FlowState) currentState).getFlows().iterator().next(); } addDanglingEndStates(); flow.setStateTransitions(transitions); dirty = false; return flow; }
protected Flow flow() { if (!dirty) { // optimization in case this method is called consecutively return flow; } flow = new SimpleFlow(name); // optimization for flows that only have one state that itself is a flow: if (currentState instanceof FlowState && states.size() == 1) { return ((FlowState) currentState).getFlows().iterator().next(); } addDanglingEndStates(); flow.setStateTransitions(transitions); dirty = false; return flow; }