Enumeration iter = this.transports.elements(); while ( iter.hasMoreElements() ) { Transporter next = (Transporter)iter.nextElement();
for(Transporter next : transports) {
    public Entity getExteriorUnitAt( int loc, boolean isRear ) {        // Walk through this entity's transport components;        // check each for an exterior unit in turn.        // Stop after the first match.        Enumeration iter = this.transports.elements();        while ( iter.hasMoreElements() ) {            Transporter next = (Transporter)iter.nextElement();            Entity exterior = next.getExteriorUnitAt( loc, isRear );            if ( null != exterior ) {                return exterior;            }        }        // If we got here, none of our transports        // carry an exterior unit at that location.        return null;    }