Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Var implements Comparable<Var> {
- private String string, replace;
- private List<Type> types;
- public Var(String string, String replace, List<Type> types) {
- this.string = string;
- this.replace = replace;
- this.types = types;
- }
- public String getKey() {
- return string;
- }
- public String getReplace() {
- return replace;
- }
- public boolean canUse(Type type) {
- return types.contains(type);
- }
- @Override
- public int compareTo(Var var) {
- if (var == null)
- return 1;
- return var.getKey().equals(this.getKey()) ? 0 : 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement