for (Enumeration i = weaponList.elements(); i.hasMoreElements();) { Mounted mounted = (Mounted)i.nextElement();
for(Mounted mounted : getWeaponList()) {
    public int getNextWeapon(int start) {        boolean past = false;        for (Enumeration i = weaponList.elements(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            //FIXME            // Logic must be inserted here to NOT always skip AMS once the            // MaxTech rule for firing AMSes is implemented.            if (past                    && (mounted != null)                    && (mounted.isReady())                    && (!mounted.getType().hasFlag(WeaponType.F_AMS))                    && ((mounted.getLinked() == null)                    || (mounted.getLinked().getShotsLeft()>0))) {                if (mounted.getType().hasFlag(WeaponType.F_TAG)                   && game.getPhase()==IGame.PHASE_FIRING) {                    continue;                }                return getEquipmentNum(mounted);            }            if (getEquipmentNum(mounted) == start) {                past = true;                continue;            }            if (past && getEquipmentNum(mounted)==start) {                return getFirstWeapon();            }        }        return getFirstWeapon();    }