Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // before
- public enum Compatibility
- {
- Compatible, Information_missing, Not_compatible;
- public Compatibility and(Compatibility other)
- {
- if(other.equals(this)) return this;
- if(other.equals(Compatible) && this.equals(Information_missing)) return Information_missing;
- if(other.equals(Information_missing) && this.equals(Compatible)) return Information_missing;
- if(other.equals(Compatible) && this.equals(Not_compatible)) return Not_compatible;
- if(other.equals(Not_compatible) && this.equals(Compatible)) return Not_compatible;
- if(other.equals(Information_missing) && this.equals(Not_compatible)) return Not_compatible;
- if(other.equals(Not_compatible) && this.equals(Information_missing)) return Not_compatible;
- return null;
- }
- public Compatibility or(Compatibility other)
- {
- if(other.equals(this)) return this;
- if(other.equals(Compatible) && this.equals(Information_missing)) return Compatible;
- if(other.equals(Information_missing) && this.equals(Compatible)) return Compatible;
- if(other.equals(Compatible) && this.equals(Not_compatible)) return Compatible;
- if(other.equals(Not_compatible) && this.equals(Compatible)) return Compatible;
- if(other.equals(Information_missing) && this.equals(Not_compatible)) return Information_missing;
- if(other.equals(Not_compatible) && this.equals(Information_missing)) return Information_missing;
- return null;
- }
- }
- // after
- public enum Compatibility
- {
- public Compatibility and(Compatibility other)
- {
- if(other.equals(this)) return this;
- if(other.equals(Compatible) && this.equals(Information_missing)) return Information_missing;
- if(other.equals(Information_missing) && this.equals(Compatible)) return Information_missing;
- if(other.equals(Compatible) && this.equals(Not_compatible)) return Not_compatible;
- if(other.equals(Not_compatible) && this.equals(Compatible)) return Not_compatible;
- if(other.equals(Information_missing) && this.equals(Not_compatible)) return Not_compatible;
- if(other.equals(Not_compatible) && this.equals(Information_missing)) return Not_compatible;
- return null;
- }, Information_missing, Not_compatible;
- public Compatibility or(Compatibility other)
- {
- if(other.equals(this)) return this;
- if(other.equals(Compatible) && this.equals(Information_missing)) return Compatible;
- if(other.equals(Information_missing) && this.equals(Compatible)) return Compatible;
- if(other.equals(Compatible) && this.equals(Not_compatible)) return Compatible;
- if(other.equals(Not_compatible) && this.equals(Compatible)) return Compatible;
- if(other.equals(Information_missing) && this.equals(Not_compatible)) return Information_missing;
- if(other.equals(Not_compatible) && this.equals(Information_missing)) return Information_missing;
- return null;
- }
- Compatible
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement