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

org.xowl.infra.lang.owl2.DataHasValue 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.owl2;

public class DataHasValue implements org.xowl.infra.lang.owl2.DataPropertyRestriction, org.xowl.infra.lang.owl2.DataHasValue_OR_LiteralElement {
    // 
    private static class dataProperty_impl implements org.xowl.infra.lang.owl2.DataPropertyAssertion_OR_DataPropertyDomain_OR_DataPropertyElement_OR_DataPropertyRange_OR_DataProp5.dataProperty {
        private org.xowl.infra.lang.owl2.DataHasValue domain;
        private org.xowl.infra.lang.owl2.DataPropertyExpression data;
        public org.xowl.infra.lang.owl2.DataPropertyExpression get_raw() { return data; }
        public org.xowl.infra.lang.owl2.DataPropertyExpression 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.owl2.DataPropertyExpression elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            if (check_contains(elem)) return false;
            if (!check_card(1)) return false;
            return true;
        }
        public boolean simple_check_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            if (!check_contains(elem)) return false;
            if (!check_card(-1)) return false;
            return true;
        }
        public boolean simple_check_replace(org.xowl.infra.lang.owl2.DataPropertyExpression oldElem, org.xowl.infra.lang.owl2.DataPropertyExpression  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.owl2.DataPropertyExpression oldElem, org.xowl.infra.lang.owl2.DataPropertyExpression  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.owl2.DataPropertyExpression oldElem, org.xowl.infra.lang.owl2.DataPropertyExpression  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.DataPropertyExpression oldElem, org.xowl.infra.lang.owl2.DataPropertyExpression  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.owl2.DataPropertyExpression elem) {
            tree_remove(elem);
        }
        public dataProperty_impl(org.xowl.infra.lang.owl2.DataHasValue domain) {
            this.domain = domain;
        }
    }
    private dataProperty_impl dataDataProperty;
    public org.xowl.infra.lang.owl2.DataPropertyAssertion_OR_DataPropertyDomain_OR_DataPropertyElement_OR_DataPropertyRange_OR_DataProp5.dataProperty __getImplOfdataProperty() { return dataDataProperty; }
    public boolean setDataProperty(org.xowl.infra.lang.owl2.DataPropertyExpression 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.owl2.DataPropertyExpression getDataProperty() { return dataDataProperty.get(); }
    // 

    // 
    private static class literal_impl implements org.xowl.infra.lang.owl2.DataHasValue_OR_LiteralElement.literal {
        private org.xowl.infra.lang.owl2.DataHasValue domain;
        private org.xowl.infra.lang.owl2.LiteralExpression data;
        public org.xowl.infra.lang.owl2.LiteralExpression get_raw() { return data; }
        public org.xowl.infra.lang.owl2.LiteralExpression 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.owl2.LiteralExpression elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            if (check_contains(elem)) return false;
            if (!check_card(1)) return false;
            return true;
        }
        public boolean simple_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            if (!check_contains(elem)) return false;
            if (!check_card(-1)) return false;
            return true;
        }
        public boolean simple_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.LiteralExpression oldElem, org.xowl.infra.lang.owl2.LiteralExpression  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.owl2.LiteralExpression elem) {
            tree_remove(elem);
        }
        public literal_impl(org.xowl.infra.lang.owl2.DataHasValue domain) {
            this.domain = domain;
        }
    }
    private literal_impl dataLiteral;
    public org.xowl.infra.lang.owl2.DataHasValue_OR_LiteralElement.literal __getImplOfliteral() { return dataLiteral; }
    public boolean setLiteral(org.xowl.infra.lang.owl2.LiteralExpression elem) {
        if (dataLiteral.get() != null) {
            if (elem == null) {
                if (!dataLiteral.user_check_remove(dataLiteral.get())) return false;
                dataLiteral.user_remove(dataLiteral.get());
            } else {
                if (!dataLiteral.user_check_replace(dataLiteral.get(), elem)) return false;
                dataLiteral.user_remove(dataLiteral.get());
                dataLiteral.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataLiteral.user_check_add(elem)) return false;
            dataLiteral.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.owl2.LiteralExpression getLiteral() { return dataLiteral.get(); }
    // 

    public DataHasValue() {
        dataDataProperty = new dataProperty_impl(this);
        dataLiteral = new literal_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy