org.xowl.infra.lang.runtime.DataMinCardinality 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 DataMinCardinality implements org.xowl.infra.lang.runtime.DataCardinalityRestriction {
//
private static class datatype_impl implements org.xowl.infra.lang.runtime.DataCardinalityRestriction_OR_NAryDataPropertyRestriction.datatype {
private org.xowl.infra.lang.runtime.DataMinCardinality domain;
private org.xowl.infra.lang.runtime.Datatype data;
public org.xowl.infra.lang.runtime.Datatype get_raw() { return data; }
public org.xowl.infra.lang.runtime.Datatype 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.Datatype elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.runtime.Datatype 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.Datatype 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.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.runtime.Datatype elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.runtime.Datatype elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.runtime.Datatype elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.runtime.Datatype elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.runtime.Datatype elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.runtime.Datatype elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.runtime.Datatype elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.runtime.Datatype elem) {
tree_remove(elem);
}
public datatype_impl(org.xowl.infra.lang.runtime.DataMinCardinality domain) {
this.domain = domain;
}
}
private datatype_impl dataDatatype;
public org.xowl.infra.lang.runtime.DataCardinalityRestriction_OR_NAryDataPropertyRestriction.datatype __getImplOfdatatype() { return dataDatatype; }
public boolean setDatatype(org.xowl.infra.lang.runtime.Datatype elem) {
if (dataDatatype.get() != null) {
if (elem == null) {
if (!dataDatatype.user_check_remove(dataDatatype.get())) return false;
dataDatatype.user_remove(dataDatatype.get());
} else {
if (!dataDatatype.user_check_replace(dataDatatype.get(), elem)) return false;
dataDatatype.user_remove(dataDatatype.get());
dataDatatype.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataDatatype.user_check_add(elem)) return false;
dataDatatype.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.runtime.Datatype getDatatype() { return dataDatatype.get(); }
//
//
private static class cardinality_impl implements org.xowl.infra.lang.runtime.CardinalityRestriction.cardinality {
private org.xowl.infra.lang.runtime.DataMinCardinality domain;
private java.lang.Integer data;
public java.lang.Integer get_raw() { return data; }
public java.lang.Integer 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(java.lang.Integer elem) { return data.equals(elem); }
public boolean simple_check_add(java.lang.Integer elem) {
if (check_contains(elem)) return false;
if (!check_card(1)) return false;
return true;
}
public boolean simple_check_remove(java.lang.Integer elem) {
if (!check_contains(elem)) return false;
if (!check_card(-1)) return false;
return true;
}
public boolean simple_check_replace(java.lang.Integer oldElem, java.lang.Integer newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(java.lang.Integer elem) {
data = elem;
}
public void simple_remove(java.lang.Integer elem) {
data = null;
}
private boolean tree_check_add(java.lang.Integer elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(java.lang.Integer elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(java.lang.Integer oldElem, java.lang.Integer newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(java.lang.Integer elem) {
simple_add(elem);
}
private void tree_remove(java.lang.Integer elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(java.lang.Integer elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(java.lang.Integer elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(java.lang.Integer oldElem, java.lang.Integer newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(java.lang.Integer elem) {
tree_add(elem);
}
@Override public void user_remove(java.lang.Integer elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(java.lang.Integer elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(java.lang.Integer elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(java.lang.Integer oldElem, java.lang.Integer newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(java.lang.Integer elem) {
tree_add(elem);
}
@Override public void inverse_remove(java.lang.Integer elem) {
tree_remove(elem);
}
public cardinality_impl(org.xowl.infra.lang.runtime.DataMinCardinality domain) {
this.domain = domain;
}
}
private cardinality_impl dataCardinality;
public org.xowl.infra.lang.runtime.CardinalityRestriction.cardinality __getImplOfcardinality() { return dataCardinality; }
public boolean setCardinality(java.lang.Integer elem) {
dataCardinality.simple_add(elem);
return true;
}
public java.lang.Integer getCardinality() { return dataCardinality.get(); }
//
//
private static class dataProperty_impl implements org.xowl.infra.lang.runtime.DataPropertyRestriction.dataProperty {
private org.xowl.infra.lang.runtime.DataMinCardinality 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.DataMinCardinality 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 DataMinCardinality() {
dataDatatype = new datatype_impl(this);
dataCardinality = new cardinality_impl(this);
dataDataProperty = new dataProperty_impl(this);
}
}