protected Coordinate[] toCoordinateArray(Stack stack){
  Coordinate[] coordinates=new Coordinate[stack.size()];
  for (int i=0; i < stack.size(); i++) {
    Coordinate coordinate=(Coordinate)stack.get(i);
    coordinates[i]=coordinate;
  }
  return coordinates;
}

protected Coordinate [ ] toCoordinateArray ( Stack stack ) { Coordinate [ ] coordinates = new Coordinate [ stack . size ( ) ] ; for ( int i = 0 ; i < stack . size ( ) ; i ++ ) { Coordinate coordinate = ( Coordinate ) stack . get ( i ) ; coordinates [ i ] = coordinate ; } return coordinates ; }
an alternative to stack . toarray , which is not present in earlier versions of java .
