public StateMachine(State[] s){
  for (int i=0; i < s.length; i++)   states.addElement(s[i]);
}

public StateMachine ( State [ ] s ) { for ( int i = 0 ; i < s . length ; i ++ ) states . addElement ( s [ i ] ) ; }
define the state machine using the array of states . order is maintained .
