org.xowl.infra.lang.rules.Rule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xowl-lang Show documentation
Show all versions of xowl-lang Show documentation
Java implementation of the xOWL language concepts
/* This file has been generated by:
xOWL Code Generator
*/
package org.xowl.infra.lang.rules;
public class Rule {
//
public static interface hasIRI {
boolean check_contains(org.xowl.infra.lang.owl2.IRI elem);
boolean user_check_add(org.xowl.infra.lang.owl2.IRI elem);
boolean user_check_remove(org.xowl.infra.lang.owl2.IRI elem);
boolean user_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem);
void user_add(org.xowl.infra.lang.owl2.IRI elem);
void user_remove(org.xowl.infra.lang.owl2.IRI elem);
boolean inverse_check_add(org.xowl.infra.lang.owl2.IRI elem);
boolean inverse_check_remove(org.xowl.infra.lang.owl2.IRI elem);
boolean inverse_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem);
void inverse_add(org.xowl.infra.lang.owl2.IRI elem);
void inverse_remove(org.xowl.infra.lang.owl2.IRI elem);
}
private static class hasIRI_impl implements org.xowl.infra.lang.rules.Rule.hasIRI {
private org.xowl.infra.lang.rules.Rule domain;
private org.xowl.infra.lang.owl2.IRI data;
public org.xowl.infra.lang.owl2.IRI get_raw() { return data; }
public org.xowl.infra.lang.owl2.IRI get() { return data; }
private boolean check_card(int modifier) {
int card = modifier + 0;
if (data != null) card++;
return (card >= 0 && card <= 1);
}
@Override public boolean check_contains(org.xowl.infra.lang.owl2.IRI elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.owl2.IRI elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.owl2.IRI elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.owl2.IRI elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.owl2.IRI elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.owl2.IRI elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.owl2.IRI elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.owl2.IRI elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.owl2.IRI elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.owl2.IRI elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.IRI elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.owl2.IRI elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.owl2.IRI elem) {
tree_remove(elem);
}
public hasIRI_impl(org.xowl.infra.lang.rules.Rule domain) {
this.domain = domain;
}
}
private hasIRI_impl dataHasIRI;
public org.xowl.infra.lang.rules.Rule.hasIRI __getImplOfhasIRI() { return dataHasIRI; }
public boolean setHasIRI(org.xowl.infra.lang.owl2.IRI elem) {
if (dataHasIRI.get() != null) {
if (elem == null) {
if (!dataHasIRI.user_check_remove(dataHasIRI.get())) return false;
dataHasIRI.user_remove(dataHasIRI.get());
} else {
if (!dataHasIRI.user_check_replace(dataHasIRI.get(), elem)) return false;
dataHasIRI.user_remove(dataHasIRI.get());
dataHasIRI.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataHasIRI.user_check_add(elem)) return false;
dataHasIRI.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.owl2.IRI getHasIRI() { return dataHasIRI.get(); }
//
//
public static interface guard {
boolean check_contains(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean user_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean user_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean user_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem);
void user_add(org.xowl.infra.lang.owl2.LiteralExpression elem);
void user_remove(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean inverse_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean inverse_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem);
boolean inverse_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem);
void inverse_add(org.xowl.infra.lang.owl2.LiteralExpression elem);
void inverse_remove(org.xowl.infra.lang.owl2.LiteralExpression elem);
}
private static class guard_impl implements org.xowl.infra.lang.rules.Rule.guard {
private org.xowl.infra.lang.rules.Rule domain;
private org.xowl.infra.lang.owl2.LiteralExpression data;
public org.xowl.infra.lang.owl2.LiteralExpression get_raw() { return data; }
public org.xowl.infra.lang.owl2.LiteralExpression get() { return data; }
private boolean check_card(int modifier) {
int card = modifier + 0;
if (data != null) card++;
return (card >= 0 && card <= 1);
}
@Override public boolean check_contains(org.xowl.infra.lang.owl2.LiteralExpression elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
tree_remove(elem);
}
public guard_impl(org.xowl.infra.lang.rules.Rule domain) {
this.domain = domain;
}
}
private guard_impl dataGuard;
public org.xowl.infra.lang.rules.Rule.guard __getImplOfguard() { return dataGuard; }
public boolean setGuard(org.xowl.infra.lang.owl2.LiteralExpression elem) {
if (dataGuard.get() != null) {
if (elem == null) {
if (!dataGuard.user_check_remove(dataGuard.get())) return false;
dataGuard.user_remove(dataGuard.get());
} else {
if (!dataGuard.user_check_replace(dataGuard.get(), elem)) return false;
dataGuard.user_remove(dataGuard.get());
dataGuard.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataGuard.user_check_add(elem)) return false;
dataGuard.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.owl2.LiteralExpression getGuard() { return dataGuard.get(); }
//
//
public static interface antecedents {
boolean check_contains(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_add(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem);
void user_add(org.xowl.infra.lang.rules.Assertion elem);
void user_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_add(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem);
void inverse_add(org.xowl.infra.lang.rules.Assertion elem);
void inverse_remove(org.xowl.infra.lang.rules.Assertion elem);
}
private static class antecedents_impl implements org.xowl.infra.lang.rules.Rule.antecedents {
private org.xowl.infra.lang.rules.Rule domain;
private java.util.List data;
public java.util.Collection get_raw() { return new java.util.ArrayList(data); }
public java.util.Collection get() { return new java.util.ArrayList(data); }
private boolean check_card(int modifier) {
int card = data.size() + 0 + modifier;
return (card >= 0 && card <= 2147483647);
}
@Override public boolean check_contains(org.xowl.infra.lang.rules.Assertion elem) { return (data.contains(elem)); }
public boolean simple_check_add(org.xowl.infra.lang.rules.Assertion elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.rules.Assertion elem) {
data.add(elem);
}
public void simple_remove(org.xowl.infra.lang.rules.Assertion elem) {
data.remove(elem);
}
private boolean tree_check_add(org.xowl.infra.lang.rules.Assertion elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.rules.Assertion elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.rules.Assertion elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.rules.Assertion elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.rules.Assertion elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.rules.Assertion elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.rules.Assertion elem) {
tree_remove(elem);
}
public antecedents_impl(org.xowl.infra.lang.rules.Rule domain) {
this.domain = domain;
this.data = new java.util.ArrayList();
}
}
private antecedents_impl dataAntecedents;
public org.xowl.infra.lang.rules.Rule.antecedents __getImplOfantecedents() { return dataAntecedents; }
public boolean addAntecedents(org.xowl.infra.lang.rules.Assertion elem) {
if (!dataAntecedents.user_check_add(elem)) return false;
dataAntecedents.user_add(elem);
return true;
}
public boolean removeAntecedents(org.xowl.infra.lang.rules.Assertion elem) {
if (!dataAntecedents.user_check_remove(elem)) return false;
dataAntecedents.user_remove(elem);
return true;
}
public java.util.Collection getAllAntecedents() { return dataAntecedents.get(); }
//
//
public static interface consequents {
boolean check_contains(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_add(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean user_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem);
void user_add(org.xowl.infra.lang.rules.Assertion elem);
void user_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_add(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_remove(org.xowl.infra.lang.rules.Assertion elem);
boolean inverse_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem);
void inverse_add(org.xowl.infra.lang.rules.Assertion elem);
void inverse_remove(org.xowl.infra.lang.rules.Assertion elem);
}
private static class consequents_impl implements org.xowl.infra.lang.rules.Rule.consequents {
private org.xowl.infra.lang.rules.Rule domain;
private java.util.List data;
public java.util.Collection get_raw() { return new java.util.ArrayList(data); }
public java.util.Collection get() { return new java.util.ArrayList(data); }
private boolean check_card(int modifier) {
int card = data.size() + 0 + modifier;
return (card >= 0 && card <= 2147483647);
}
@Override public boolean check_contains(org.xowl.infra.lang.rules.Assertion elem) { return (data.contains(elem)); }
public boolean simple_check_add(org.xowl.infra.lang.rules.Assertion elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.rules.Assertion elem) {
data.add(elem);
}
public void simple_remove(org.xowl.infra.lang.rules.Assertion elem) {
data.remove(elem);
}
private boolean tree_check_add(org.xowl.infra.lang.rules.Assertion elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.rules.Assertion elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.rules.Assertion elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.rules.Assertion elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.rules.Assertion elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.rules.Assertion elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.rules.Assertion oldElem, org.xowl.infra.lang.rules.Assertion newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.rules.Assertion elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.rules.Assertion elem) {
tree_remove(elem);
}
public consequents_impl(org.xowl.infra.lang.rules.Rule domain) {
this.domain = domain;
this.data = new java.util.ArrayList();
}
}
private consequents_impl dataConsequents;
public org.xowl.infra.lang.rules.Rule.consequents __getImplOfconsequents() { return dataConsequents; }
public boolean addConsequents(org.xowl.infra.lang.rules.Assertion elem) {
if (!dataConsequents.user_check_add(elem)) return false;
dataConsequents.user_add(elem);
return true;
}
public boolean removeConsequents(org.xowl.infra.lang.rules.Assertion elem) {
if (!dataConsequents.user_check_remove(elem)) return false;
dataConsequents.user_remove(elem);
return true;
}
public java.util.Collection getAllConsequents() { return dataConsequents.get(); }
//
public Rule() {
dataHasIRI = new hasIRI_impl(this);
dataGuard = new guard_impl(this);
dataAntecedents = new antecedents_impl(this);
dataConsequents = new consequents_impl(this);
}
}