public boolean addTo(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int added = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.addConjunctionByConjunct(entry.getValue(), entry.getKey())) added++; else { success = false; break; } } if (success) return true; // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (added == 0) break; added--; rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }
public boolean removeFrom(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int removed = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey())) removed++; else { success = false; break; } } if (success) { return true; } // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (removed == 0) break; removed--; rule.addConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }
public boolean removeFrom(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int removed = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey())) removed++; else { success = false; break; } } if (success) { return true; } // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (removed == 0) break; removed--; rule.addConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }
public boolean addTo(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int added = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.addConjunctionByConjunct(entry.getValue(), entry.getKey())) added++; else { success = false; break; } } if (success) return true; // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (added == 0) break; added--; rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }
public boolean addTo(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int added = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.addConjunctionByConjunct(entry.getValue(), entry.getKey())) added++; else { success = false; break; } } if (success) return true; // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (added == 0) break; added--; rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }
public boolean removeFrom(AbstractObjectIntersectionFromConjunctRule rule) { boolean success = true; int removed = 0; for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (rule.removeConjunctionByConjunct(entry.getValue(), entry.getKey())) removed++; else { success = false; break; } } if (success) { return true; } // else revert all changes for (Map.Entry<IndexedClassExpression, IndexedObjectIntersectionOf> entry : this.conjunctionsByConjunct_ .entrySet()) { if (removed == 0) break; removed--; rule.addConjunctionByConjunct(entry.getValue(), entry.getKey()); } return false; }