org.xowl.infra.lang.runtime.DataHasValue 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.runtime;
public class DataHasValue implements org.xowl.infra.lang.runtime.DataPropertyRestriction {
//
private static class dataProperty_impl implements org.xowl.infra.lang.runtime.DataPropertyRestriction.dataProperty {
private org.xowl.infra.lang.runtime.DataHasValue domain;
private org.xowl.infra.lang.runtime.DataProperty data;
public org.xowl.infra.lang.runtime.DataProperty get_raw() { return data; }
public org.xowl.infra.lang.runtime.DataProperty 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.runtime.DataProperty elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.runtime.DataProperty oldElem, org.xowl.infra.lang.runtime.DataProperty newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.runtime.DataProperty elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.runtime.DataProperty oldElem, org.xowl.infra.lang.runtime.DataProperty newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.runtime.DataProperty elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.runtime.DataProperty oldElem, org.xowl.infra.lang.runtime.DataProperty newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.runtime.DataProperty elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.DataProperty oldElem, org.xowl.infra.lang.runtime.DataProperty newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.runtime.DataProperty elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
tree_remove(elem);
}
public dataProperty_impl(org.xowl.infra.lang.runtime.DataHasValue domain) {
this.domain = domain;
}
}
private dataProperty_impl dataDataProperty;
public org.xowl.infra.lang.runtime.DataPropertyRestriction.dataProperty __getImplOfdataProperty() { return dataDataProperty; }
public boolean setDataProperty(org.xowl.infra.lang.runtime.DataProperty elem) {
if (dataDataProperty.get() != null) {
if (elem == null) {
if (!dataDataProperty.user_check_remove(dataDataProperty.get())) return false;
dataDataProperty.user_remove(dataDataProperty.get());
} else {
if (!dataDataProperty.user_check_replace(dataDataProperty.get(), elem)) return false;
dataDataProperty.user_remove(dataDataProperty.get());
dataDataProperty.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataDataProperty.user_check_add(elem)) return false;
dataDataProperty.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.runtime.DataProperty getDataProperty() { return dataDataProperty.get(); }
//
//
public static interface literal {
boolean check_contains(org.xowl.infra.lang.runtime.Literal elem);
boolean user_check_add(org.xowl.infra.lang.runtime.Literal elem);
boolean user_check_remove(org.xowl.infra.lang.runtime.Literal elem);
boolean user_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem);
void user_add(org.xowl.infra.lang.runtime.Literal elem);
void user_remove(org.xowl.infra.lang.runtime.Literal elem);
boolean inverse_check_add(org.xowl.infra.lang.runtime.Literal elem);
boolean inverse_check_remove(org.xowl.infra.lang.runtime.Literal elem);
boolean inverse_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem);
void inverse_add(org.xowl.infra.lang.runtime.Literal elem);
void inverse_remove(org.xowl.infra.lang.runtime.Literal elem);
}
private static class literal_impl implements org.xowl.infra.lang.runtime.DataHasValue.literal {
private org.xowl.infra.lang.runtime.DataHasValue domain;
private org.xowl.infra.lang.runtime.Literal data;
public org.xowl.infra.lang.runtime.Literal get_raw() { return data; }
public org.xowl.infra.lang.runtime.Literal 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.runtime.Literal elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.runtime.Literal elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(org.xowl.infra.lang.runtime.Literal elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.runtime.Literal elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.runtime.Literal elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.runtime.Literal elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.runtime.Literal elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.runtime.Literal elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.runtime.Literal elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.runtime.Literal elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Literal elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.runtime.Literal elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.runtime.Literal elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Literal elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Literal elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Literal oldElem, org.xowl.infra.lang.runtime.Literal newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.runtime.Literal elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.runtime.Literal elem) {
tree_remove(elem);
}
public literal_impl(org.xowl.infra.lang.runtime.DataHasValue domain) {
this.domain = domain;
}
}
private literal_impl dataLiteral;
public org.xowl.infra.lang.runtime.DataHasValue.literal __getImplOfliteral() { return dataLiteral; }
public boolean setLiteral(org.xowl.infra.lang.runtime.Literal elem) {
if (dataLiteral.get() != null) {
if (elem == null) {
if (!dataLiteral.user_check_remove(dataLiteral.get())) return false;
dataLiteral.user_remove(dataLiteral.get());
} else {
if (!dataLiteral.user_check_replace(dataLiteral.get(), elem)) return false;
dataLiteral.user_remove(dataLiteral.get());
dataLiteral.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataLiteral.user_check_add(elem)) return false;
dataLiteral.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.runtime.Literal getLiteral() { return dataLiteral.get(); }
//
public DataHasValue() {
dataDataProperty = new dataProperty_impl(this);
dataLiteral = new literal_impl(this);
}
}