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

org.xowl.infra.lang.runtime.ObjectPropertyAssertion 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 ObjectPropertyAssertion implements org.xowl.infra.lang.runtime.PropertyAssertion {
    // 
    private static class isNegative_impl implements org.xowl.infra.lang.runtime.PropertyAssertion.isNegative {
        private org.xowl.infra.lang.runtime.ObjectPropertyAssertion domain;
        private java.lang.Boolean data;
        public java.lang.Boolean get_raw() { return data; }
        public java.lang.Boolean 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.Boolean elem) { return data.equals(elem); }
        public boolean simple_check_add(java.lang.Boolean elem) {
            if (check_contains(elem)) return false;
            if (!check_card(1)) return false;
            return true;
        }
        public boolean simple_check_remove(java.lang.Boolean elem) {
            if (!check_contains(elem)) return false;
            if (!check_card(-1)) return false;
            return true;
        }
        public boolean simple_check_replace(java.lang.Boolean oldElem, java.lang.Boolean  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(java.lang.Boolean elem) {
            data = elem;
        }
        public void simple_remove(java.lang.Boolean elem) {
            data = null;
        }
        private boolean tree_check_add(java.lang.Boolean elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(java.lang.Boolean elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(java.lang.Boolean oldElem, java.lang.Boolean  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(java.lang.Boolean elem) {
            simple_add(elem);
        }
        private void tree_remove(java.lang.Boolean elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(java.lang.Boolean elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(java.lang.Boolean elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(java.lang.Boolean oldElem, java.lang.Boolean  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(java.lang.Boolean elem) {
            tree_add(elem);
        }
        @Override public void user_remove(java.lang.Boolean elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(java.lang.Boolean elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(java.lang.Boolean elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(java.lang.Boolean oldElem, java.lang.Boolean  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(java.lang.Boolean elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(java.lang.Boolean elem) {
            tree_remove(elem);
        }
        public isNegative_impl(org.xowl.infra.lang.runtime.ObjectPropertyAssertion domain) {
            this.domain = domain;
        }
    }
    private isNegative_impl dataIsNegative;
    public org.xowl.infra.lang.runtime.PropertyAssertion.isNegative __getImplOfisNegative() { return dataIsNegative; }
    public boolean setIsNegative(java.lang.Boolean elem) {
        dataIsNegative.simple_add(elem);
        return true;
    }
    public java.lang.Boolean getIsNegative() { return dataIsNegative.get(); }
    // 

    // 
    private static class property_impl implements org.xowl.infra.lang.runtime.PropertyAssertion.property {
        private org.xowl.infra.lang.runtime.ObjectPropertyAssertion 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);
        }
        public boolean check_contains(org.xowl.infra.lang.runtime.ObjectProperty elem) { return (data == elem); }
        @Override public boolean check_contains(org.xowl.infra.lang.runtime.Property elem) {
            if (!(elem instanceof org.xowl.infra.lang.runtime.ObjectProperty)) return false;
            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);
        }
        public boolean user_check_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            return tree_check_add(elem);
        }
        public boolean user_check_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            return tree_check_remove(elem);
        }
        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);
        }
        public void user_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            tree_add(elem);
        }
        public void user_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            tree_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.runtime.Property elem) { return user_check_add((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Property elem) { return user_check_remove((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Property oldElem, org.xowl.infra.lang.runtime.Property  newElem) { return user_check_replace((org.xowl.infra.lang.runtime.ObjectProperty)oldElem, (org.xowl.infra.lang.runtime.ObjectProperty)newElem); }
        @Override public void user_add(org.xowl.infra.lang.runtime.Property elem) { user_add((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public void user_remove(org.xowl.infra.lang.runtime.Property elem) { user_remove((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        public boolean inverse_check_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            return tree_check_add(elem);
        }
        public boolean inverse_check_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            return tree_check_remove(elem);
        }
        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);
        }
        public void inverse_add(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            tree_add(elem);
        }
        public void inverse_remove(org.xowl.infra.lang.runtime.ObjectProperty elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Property elem) { return inverse_check_add((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Property elem) { return inverse_check_remove((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Property oldElem, org.xowl.infra.lang.runtime.Property  newElem) { return inverse_check_replace((org.xowl.infra.lang.runtime.ObjectProperty)oldElem, (org.xowl.infra.lang.runtime.ObjectProperty)newElem); }
        @Override public void inverse_add(org.xowl.infra.lang.runtime.Property elem) { inverse_add((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        @Override public void inverse_remove(org.xowl.infra.lang.runtime.Property elem) { inverse_remove((org.xowl.infra.lang.runtime.ObjectProperty)elem); }
        public property_impl(org.xowl.infra.lang.runtime.ObjectPropertyAssertion domain) {
            this.domain = domain;
        }
    }
    private property_impl dataProperty;
    public org.xowl.infra.lang.runtime.PropertyAssertion.property __getImplOfproperty() { return dataProperty; }
    public boolean setProperty(org.xowl.infra.lang.runtime.Property elem) {
        if (dataProperty.get() != null) {
            if (elem == null) {
                if (!dataProperty.user_check_remove(dataProperty.get())) return false;
                dataProperty.user_remove(dataProperty.get());
            } else {
                if (!dataProperty.user_check_replace(dataProperty.get(), (org.xowl.infra.lang.runtime.ObjectProperty)elem)) return false;
                dataProperty.user_remove(dataProperty.get());
                dataProperty.user_add((org.xowl.infra.lang.runtime.ObjectProperty)elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataProperty.user_check_add((org.xowl.infra.lang.runtime.ObjectProperty)elem)) return false;
            dataProperty.user_add((org.xowl.infra.lang.runtime.ObjectProperty)elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Property getPropertyAs(org.xowl.infra.lang.runtime.Property type) { return dataProperty.get(); }
    public boolean setProperty(org.xowl.infra.lang.runtime.ObjectProperty elem) {
        if (dataProperty.get() != null) {
            if (elem == null) {
                if (!dataProperty.user_check_remove(dataProperty.get())) return false;
                dataProperty.user_remove(dataProperty.get());
            } else {
                if (!dataProperty.user_check_replace(dataProperty.get(), elem)) return false;
                dataProperty.user_remove(dataProperty.get());
                dataProperty.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataProperty.user_check_add(elem)) return false;
            dataProperty.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.ObjectProperty getPropertyAs(org.xowl.infra.lang.runtime.ObjectProperty type) { return dataProperty.get(); }
    // 

    // 
    public static interface valueIndividual {
        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 valueIndividual_impl implements org.xowl.infra.lang.runtime.ObjectPropertyAssertion.valueIndividual {
        private org.xowl.infra.lang.runtime.ObjectPropertyAssertion 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 valueIndividual_impl(org.xowl.infra.lang.runtime.ObjectPropertyAssertion domain) {
            this.domain = domain;
        }
    }
    private valueIndividual_impl dataValueIndividual;
    public org.xowl.infra.lang.runtime.ObjectPropertyAssertion.valueIndividual __getImplOfvalueIndividual() { return dataValueIndividual; }
    public boolean setValueIndividual(org.xowl.infra.lang.runtime.Individual elem) {
        if (dataValueIndividual.get() != null) {
            if (elem == null) {
                if (!dataValueIndividual.user_check_remove(dataValueIndividual.get())) return false;
                dataValueIndividual.user_remove(dataValueIndividual.get());
            } else {
                if (!dataValueIndividual.user_check_replace(dataValueIndividual.get(), elem)) return false;
                dataValueIndividual.user_remove(dataValueIndividual.get());
                dataValueIndividual.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataValueIndividual.user_check_add(elem)) return false;
            dataValueIndividual.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Individual getValueIndividual() { return dataValueIndividual.get(); }
    // 

    public ObjectPropertyAssertion() {
        dataIsNegative = new isNegative_impl(this);
        dataProperty = new property_impl(this);
        dataValueIndividual = new valueIndividual_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy