public static MOPParameters unionSet(MOPParameters set1, MOPParameters set2) { MOPParameters ret = new MOPParameters(); if (set1 != null) ret.addAll(set1); if (set2 != null) ret.addAll(set2); return ret; }
public boolean matchTypes(MOPParameters set) { if (this.size() != set.size()) return false; for (int i = 0; i < this.parameters.size(); i++) { if (this.parameters.get(i).getType().getOp().equals(set.get(i).getType().getOp())) { return false; } } return true; }
public MOPParameters sortParam(MOPParameters set) { MOPParameters ret = new MOPParameters(); for (MOPParameter p : this.parameters) { if (set.contains(p)) ret.add(p); } for (MOPParameter p : set.parameters) { if (!ret.contains(p)) ret.add(p); } return ret; }
public static MOPParameters intersectionSet(MOPParameters set1, MOPParameters set2) { MOPParameters ret = new MOPParameters(); for (MOPParameter p1 : set1) { for (MOPParameter p2 : set2) { if (p1.getName().compareTo(p2.getName()) == 0) { ret.add(p1); break; } } } return ret; }
public boolean equals(MOPParameters set) { if (set == null) return false; if (this.size() != set.size()) return false; return this.contains(set) && set.contains(this); }