All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xowl.infra.lang.runtime.ObjectExactCardinality Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
/* This file has been generated by:
   xOWL Code Generator
*/
package org.xowl.infra.lang.runtime;

public class ObjectExactCardinality implements org.xowl.infra.lang.runtime.ObjectCardinalityRestriction {
    // 
    private static class cardinality_impl implements org.xowl.infra.lang.runtime.CardinalityRestriction.cardinality {
        private org.xowl.infra.lang.runtime.ObjectExactCardinality 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.ObjectExactCardinality 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 objectProperty_impl implements org.xowl.infra.lang.runtime.ObjectPropertyRestriction.objectProperty {
        private org.xowl.infra.lang.runtime.ObjectExactCardinality 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.ObjectExactCardinality 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(); }
    // 

    // 
    private static class classe_impl implements org.xowl.infra.lang.runtime.ObjectAllValuesFrom_OR_ObjectCardinalityRestriction_OR_ObjectSomeValuesFrom.classe {
        private org.xowl.infra.lang.runtime.ObjectExactCardinality domain;
        private org.xowl.infra.lang.runtime.Class data;
        public org.xowl.infra.lang.runtime.Class get_raw() { return data; }
        public org.xowl.infra.lang.runtime.Class 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.Class elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.runtime.Class 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.Class 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.Class oldElem, org.xowl.infra.lang.runtime.Class  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.runtime.Class elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.runtime.Class elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.runtime.Class elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.runtime.Class elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.runtime.Class oldElem, org.xowl.infra.lang.runtime.Class  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.runtime.Class elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.runtime.Class elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.runtime.Class elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Class elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Class oldElem, org.xowl.infra.lang.runtime.Class  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.runtime.Class elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.runtime.Class elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Class elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Class elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Class oldElem, org.xowl.infra.lang.runtime.Class  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.runtime.Class elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.runtime.Class elem) {
            tree_remove(elem);
        }
        public classe_impl(org.xowl.infra.lang.runtime.ObjectExactCardinality domain) {
            this.domain = domain;
        }
    }
    private classe_impl dataClasse;
    public org.xowl.infra.lang.runtime.ObjectAllValuesFrom_OR_ObjectCardinalityRestriction_OR_ObjectSomeValuesFrom.classe __getImplOfclasse() { return dataClasse; }
    public boolean setClasse(org.xowl.infra.lang.runtime.Class elem) {
        if (dataClasse.get() != null) {
            if (elem == null) {
                if (!dataClasse.user_check_remove(dataClasse.get())) return false;
                dataClasse.user_remove(dataClasse.get());
            } else {
                if (!dataClasse.user_check_replace(dataClasse.get(), elem)) return false;
                dataClasse.user_remove(dataClasse.get());
                dataClasse.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataClasse.user_check_add(elem)) return false;
            dataClasse.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Class getClasse() { return dataClasse.get(); }
    // 

    public ObjectExactCardinality() {
        dataCardinality = new cardinality_impl(this);
        dataObjectProperty = new objectProperty_impl(this);
        dataClasse = new classe_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy