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

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

    // 
    private static class valueLiteral_impl implements org.xowl.infra.lang.runtime.DataPropertyAssertion_OR_DatatypeRestriction.valueLiteral {
        private org.xowl.infra.lang.runtime.DataPropertyAssertion 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 valueLiteral_impl(org.xowl.infra.lang.runtime.DataPropertyAssertion domain) {
            this.domain = domain;
        }
    }
    private valueLiteral_impl dataValueLiteral;
    public org.xowl.infra.lang.runtime.DataPropertyAssertion_OR_DatatypeRestriction.valueLiteral __getImplOfvalueLiteral() { return dataValueLiteral; }
    public boolean setValueLiteral(org.xowl.infra.lang.runtime.Literal elem) {
        if (dataValueLiteral.get() != null) {
            if (elem == null) {
                if (!dataValueLiteral.user_check_remove(dataValueLiteral.get())) return false;
                dataValueLiteral.user_remove(dataValueLiteral.get());
            } else {
                if (!dataValueLiteral.user_check_replace(dataValueLiteral.get(), elem)) return false;
                dataValueLiteral.user_remove(dataValueLiteral.get());
                dataValueLiteral.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataValueLiteral.user_check_add(elem)) return false;
            dataValueLiteral.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Literal getValueLiteral() { return dataValueLiteral.get(); }
    // 

    public DataPropertyAssertion() {
        dataIsNegative = new isNegative_impl(this);
        dataProperty = new property_impl(this);
        dataValueLiteral = new valueLiteral_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy