@Override public ObjectUnionFromDisjunctRule create(ChainableSubsumerRule tail) { return new ObjectUnionFromDisjunctRule(tail); } };
@Override public ObjectUnionFromDisjunctRule create(ChainableSubsumerRule tail) { return new ObjectUnionFromDisjunctRule(tail); } };
@Override public ObjectUnionFromDisjunctRule create(ChainableSubsumerRule tail) { return new ObjectUnionFromDisjunctRule(tail); } };
public static boolean removeRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int removed = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.remove(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { removed++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (removed == 0) break; // else removed--; index.add(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }
public static boolean addRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int added = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.add(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { added++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (added == 0) break; // else added--; index.remove(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }
public static boolean addRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int added = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.add(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { added++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (added == 0) break; // else added--; index.remove(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }
public static boolean removeRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int removed = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.remove(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { removed++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (removed == 0) break; // else removed--; index.add(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }
public static boolean addRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int added = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.add(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { added++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (added == 0) break; // else added--; index.remove(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }
public static boolean removeRulesFor( ModifiableIndexedObjectUnionOf disjunction, ModifiableOntologyIndex index) { boolean success = true; int removed = 0; List<? extends ModifiableIndexedClassExpression> disjuncts = disjunction .getDisjuncts(); for (int pos = 0; pos < disjuncts.size(); pos++) { ModifiableIndexedClassExpression disjunct = disjuncts.get(pos); if (index.remove(disjunct, new ObjectUnionFromDisjunctRule(disjunction, pos))) { removed++; } else { success = false; break; } } if (success) return true; // else revert the changes made for (int pos = 0; pos < disjuncts.size(); pos++) { if (removed == 0) break; // else removed--; index.add(disjuncts.get(pos), new ObjectUnionFromDisjunctRule(disjunction, pos)); } return false; }