org.xowl.infra.lang.runtime.ObjectHasValue 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 ObjectHasValue implements org.xowl.infra.lang.runtime.ObjectPropertyRestriction {
//
public static interface individual {
boolean check_contains(org.xowl.infra.lang.runtime.Individual elem);
boolean user_check_add(org.xowl.infra.lang.runtime.Individual elem);
boolean user_check_remove(org.xowl.infra.lang.runtime.Individual elem);
boolean user_check_replace(org.xowl.infra.lang.runtime.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem);
void user_add(org.xowl.infra.lang.runtime.Individual elem);
void user_remove(org.xowl.infra.lang.runtime.Individual elem);
boolean inverse_check_add(org.xowl.infra.lang.runtime.Individual elem);
boolean inverse_check_remove(org.xowl.infra.lang.runtime.Individual elem);
boolean inverse_check_replace(org.xowl.infra.lang.runtime.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem);
void inverse_add(org.xowl.infra.lang.runtime.Individual elem);
void inverse_remove(org.xowl.infra.lang.runtime.Individual elem);
}
private static class individual_impl implements org.xowl.infra.lang.runtime.ObjectHasValue.individual {
private org.xowl.infra.lang.runtime.ObjectHasValue domain;
private org.xowl.infra.lang.runtime.Individual data;
public org.xowl.infra.lang.runtime.Individual get_raw() { return data; }
public org.xowl.infra.lang.runtime.Individual 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.Individual elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.runtime.Individual 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.Individual 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.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.runtime.Individual elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.runtime.Individual elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.runtime.Individual elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.runtime.Individual elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.runtime.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.runtime.Individual elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.runtime.Individual elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.runtime.Individual elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Individual elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.runtime.Individual elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.runtime.Individual elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Individual elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Individual elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Individual oldElem, org.xowl.infra.lang.runtime.Individual newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.runtime.Individual elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.runtime.Individual elem) {
tree_remove(elem);
}
public individual_impl(org.xowl.infra.lang.runtime.ObjectHasValue domain) {
this.domain = domain;
}
}
private individual_impl dataIndividual;
public org.xowl.infra.lang.runtime.ObjectHasValue.individual __getImplOfindividual() { return dataIndividual; }
public boolean setIndividual(org.xowl.infra.lang.runtime.Individual elem) {
if (dataIndividual.get() != null) {
if (elem == null) {
if (!dataIndividual.user_check_remove(dataIndividual.get())) return false;
dataIndividual.user_remove(dataIndividual.get());
} else {
if (!dataIndividual.user_check_replace(dataIndividual.get(), elem)) return false;
dataIndividual.user_remove(dataIndividual.get());
dataIndividual.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataIndividual.user_check_add(elem)) return false;
dataIndividual.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.runtime.Individual getIndividual() { return dataIndividual.get(); }
//
//
private static class objectProperty_impl implements org.xowl.infra.lang.runtime.ObjectPropertyRestriction.objectProperty {
private org.xowl.infra.lang.runtime.ObjectHasValue domain;
private org.xowl.infra.lang.runtime.ObjectProperty data;
public org.xowl.infra.lang.runtime.ObjectProperty get_raw() { return data; }
public org.xowl.infra.lang.runtime.ObjectProperty 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.ObjectProperty elem) { return (data == elem); }
public boolean simple_check_add(org.xowl.infra.lang.runtime.ObjectProperty 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.ObjectProperty 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.ObjectProperty oldElem, org.xowl.infra.lang.runtime.ObjectProperty newElem) {
if (check_contains(newElem)) return false;
if (!check_contains(oldElem)) return false;
return true;
}
public void simple_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
data = elem;
}
public void simple_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
data = null;
}
private boolean tree_check_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
if (!simple_check_add(elem)) return false;
return true;
}
private boolean tree_check_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
if (!simple_check_remove(elem)) return false;
return true;
}
private boolean tree_check_replace(org.xowl.infra.lang.runtime.ObjectProperty oldElem, org.xowl.infra.lang.runtime.ObjectProperty newElem) {
if (!simple_check_replace(oldElem, newElem)) return false;
return true;
}
private void tree_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
simple_add(elem);
}
private void tree_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
simple_remove(elem);
}
@Override public boolean user_check_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
return tree_check_add(elem);
}
@Override public boolean user_check_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
return tree_check_remove(elem);
}
@Override public boolean user_check_replace(org.xowl.infra.lang.runtime.ObjectProperty oldElem, org.xowl.infra.lang.runtime.ObjectProperty newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void user_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
tree_add(elem);
}
@Override public void user_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
tree_remove(elem);
}
@Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
return tree_check_add(elem);
}
@Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
return tree_check_remove(elem);
}
@Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.ObjectProperty oldElem, org.xowl.infra.lang.runtime.ObjectProperty newElem) {
return tree_check_replace(oldElem, newElem);
}
@Override public void inverse_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
tree_add(elem);
}
@Override public void inverse_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
tree_remove(elem);
}
public objectProperty_impl(org.xowl.infra.lang.runtime.ObjectHasValue domain) {
this.domain = domain;
}
}
private objectProperty_impl dataObjectProperty;
public org.xowl.infra.lang.runtime.ObjectPropertyRestriction.objectProperty __getImplOfobjectProperty() { return dataObjectProperty; }
public boolean setObjectProperty(org.xowl.infra.lang.runtime.ObjectProperty elem) {
if (dataObjectProperty.get() != null) {
if (elem == null) {
if (!dataObjectProperty.user_check_remove(dataObjectProperty.get())) return false;
dataObjectProperty.user_remove(dataObjectProperty.get());
} else {
if (!dataObjectProperty.user_check_replace(dataObjectProperty.get(), elem)) return false;
dataObjectProperty.user_remove(dataObjectProperty.get());
dataObjectProperty.user_add(elem);
}
} else {
if (elem == null) return true;
if (!dataObjectProperty.user_check_add(elem)) return false;
dataObjectProperty.user_add(elem);
}
return true;
}
public org.xowl.infra.lang.runtime.ObjectProperty getObjectProperty() { return dataObjectProperty.get(); }
//
public ObjectHasValue() {
dataIndividual = new individual_impl(this);
dataObjectProperty = new objectProperty_impl(this);
}
}