WeaponType wt = (WeaponType)((Mounted)entity.getWeaponList().elementAt(i)).getType();
WeaponType wt = (WeaponType)((Mounted)entity.getWeaponList().get(i)).getType();
    private boolean isMatch(Entity entity) {        int walk = -1;        try {            walk = Integer.parseInt(m_tWalk.getText());        } catch (NumberFormatException ne) { }        if (walk > -1) {            if (m_cWalk.getSelectedIndex() == 0) { //at least                if (entity.getWalkMP() < walk)                    return false;            } else if (m_cWalk.getSelectedIndex() == 1) { //equal to                if (walk != entity.getWalkMP())                    return false;            } else if (m_cWalk.getSelectedIndex() == 2) { //not more than                if (entity.getWalkMP() > walk)                    return false;            }        }        int jump = -1;        try {            jump = Integer.parseInt(m_tJump.getText());        } catch (NumberFormatException ne) { }        if (jump > -1) {            if (m_cJump.getSelectedIndex() == 0) { //at least                if (entity.getJumpMP() < jump)                    return false;            } else if (m_cJump.getSelectedIndex() == 1) { //equal to                if (jump != entity.getJumpMP())                    return false;            } else if (m_cJump.getSelectedIndex() == 2) { //not more than                if (entity.getJumpMP() > jump)                    return false;            }        }        int sel = m_cArmor.getSelectedIndex();        if (sel > 0) {            int armor = entity.getTotalArmor();            int maxArmor = entity.getTotalInternal() * 2 + 3;            if (sel == 1) {                if (armor < (maxArmor * .25))                    return false;            } else if (sel == 2) {                if (armor < (maxArmor * .5))                    return false;            } else if (sel == 3) {                if (armor < (maxArmor * .75))                    return false;            } else if (sel == 4) {                if (armor < (maxArmor * .9))                    return false;            }        }        boolean weaponLine1Active = false;        boolean weaponLine2Active = false;        boolean foundWeapon1 = false;        boolean foundWeapon2 = false;        int count = 0;        int weapon1 = -1;        try {            weapon1 = Integer.parseInt(m_tWeapons1.getText());        } catch (NumberFormatException ne) { }        if (weapon1 > -1) {            weaponLine1Active = true;            for (int i = 0; i < entity.getWeaponList().size(); i++) {                WeaponType wt = (WeaponType)((Mounted)entity.getWeaponList().elementAt(i)).getType();                if (wt.getName().equals(m_cWeapons1.getSelectedItem())) {                    count++;                }            }            if (count >= weapon1)                foundWeapon1 = true;        }        count = 0;        int weapon2 = -1;        try {            weapon2 = Integer.parseInt(m_tWeapons2.getText());        } catch (NumberFormatException ne) { }        if (weapon2 > -1) {            weaponLine2Active = true;            for (int i = 0; i < entity.getWeaponList().size(); i++) {                WeaponType wt = (WeaponType)((Mounted)entity.getWeaponList().elementAt(i)).getType();                if (wt.getName().equals(m_cWeapons2.getSelectedItem())) {                    count++;                }            }            if (count >= weapon2)                foundWeapon2 = true;        }        if (weaponLine1Active && !weaponLine2Active && !foundWeapon1)            return false;        if (weaponLine2Active && !weaponLine1Active && !foundWeapon2)            return false;        if (weaponLine1Active && weaponLine2Active) {            if (m_cOrAnd.getSelectedIndex() == 0 /* 0 is "or" choice */) {                if (!foundWeapon1 && !foundWeapon2)                    return false;            } else { //"and" choice in effect                if (!foundWeapon1 || !foundWeapon2)                    return false;            }        }        count = 0;        if (m_chkEquipment.getState()) {            for (Enumeration e = entity.getMisc(); e.hasMoreElements(); ) {                MiscType mt = (MiscType)((Mounted)e.nextElement()).getType();                if (mt.getName().equals(m_cEquipment.getSelectedItem())) {                    count++;                }            }            if (count < 1)                return false;        }        return true;    }