private int getPreviousStep ( int currentStep ) { int prevStep = - 1 ; // we find the next available step. for ( int i = currentStep - 1 ; i >= STEP_LOGIN ; i -- ) { if ( isStepEnabled ( i ) ) { prevStep = i ; break ; } } return prevStep ; }
Get the previous step given the current . Will check available steps to confirm .