public boolean equals(Object obj) {
        if (obj instanceof Criteria) {
            Criteria c = (Criteria) obj;
            
            boolean sameCostSetting = ! (isCostAllowed() ^ c.isCostAllowed());
            boolean sameCourseSetting = ! (isCourseRequired() ^ c.isCourseRequired());
            boolean sameSpeedSetting = ! (isSpeedRequired() ^ c.isSpeedRequired());
            boolean sameAltSetting = ! (isAltitudeReguired() ^ c.isAltitudeReguired());
            boolean sameAccuracySetting = (getAccuracy() == c.getAccuracy());
            
            return (sameAccuracySetting 
                    && sameAltSetting
                    && sameCostSetting 
                    && sameCourseSetting 
                    && sameSpeedSetting);
        }
        else {
            return false;
        }
    }