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

org.xowl.infra.lang.owl2.FacetRestriction 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 FacetRestriction {
    // 
    public static interface constrainingValue {
        boolean check_contains(org.xowl.infra.lang.owl2.Literal elem);
        boolean user_check_add(org.xowl.infra.lang.owl2.Literal elem);
        boolean user_check_remove(org.xowl.infra.lang.owl2.Literal elem);
        boolean user_check_replace(org.xowl.infra.lang.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem);
        void user_add(org.xowl.infra.lang.owl2.Literal elem);
        void user_remove(org.xowl.infra.lang.owl2.Literal elem);
        boolean inverse_check_add(org.xowl.infra.lang.owl2.Literal elem);
        boolean inverse_check_remove(org.xowl.infra.lang.owl2.Literal elem);
        boolean inverse_check_replace(org.xowl.infra.lang.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem);
        void inverse_add(org.xowl.infra.lang.owl2.Literal elem);
        void inverse_remove(org.xowl.infra.lang.owl2.Literal elem);
    }
    private static class constrainingValue_impl implements org.xowl.infra.lang.owl2.FacetRestriction.constrainingValue {
        private org.xowl.infra.lang.owl2.FacetRestriction domain;
        private org.xowl.infra.lang.owl2.Literal data;
        public org.xowl.infra.lang.owl2.Literal get_raw() { return data; }
        public org.xowl.infra.lang.owl2.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.owl2.Literal elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.owl2.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.owl2.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.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.owl2.Literal elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.owl2.Literal elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.owl2.Literal elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.owl2.Literal elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.owl2.Literal elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.owl2.Literal elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.owl2.Literal elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.owl2.Literal elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.owl2.Literal elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.owl2.Literal elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.Literal elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.Literal elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.Literal oldElem, org.xowl.infra.lang.owl2.Literal  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.owl2.Literal elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.owl2.Literal elem) {
            tree_remove(elem);
        }
        public constrainingValue_impl(org.xowl.infra.lang.owl2.FacetRestriction domain) {
            this.domain = domain;
        }
    }
    private constrainingValue_impl dataConstrainingValue;
    public org.xowl.infra.lang.owl2.FacetRestriction.constrainingValue __getImplOfconstrainingValue() { return dataConstrainingValue; }
    public boolean setConstrainingValue(org.xowl.infra.lang.owl2.Literal elem) {
        if (dataConstrainingValue.get() != null) {
            if (elem == null) {
                if (!dataConstrainingValue.user_check_remove(dataConstrainingValue.get())) return false;
                dataConstrainingValue.user_remove(dataConstrainingValue.get());
            } else {
                if (!dataConstrainingValue.user_check_replace(dataConstrainingValue.get(), elem)) return false;
                dataConstrainingValue.user_remove(dataConstrainingValue.get());
                dataConstrainingValue.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataConstrainingValue.user_check_add(elem)) return false;
            dataConstrainingValue.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.owl2.Literal getConstrainingValue() { return dataConstrainingValue.get(); }
    // 

    // 
    public static interface constrainingFacet {
        boolean check_contains(org.xowl.infra.lang.owl2.IRI elem);
        boolean user_check_add(org.xowl.infra.lang.owl2.IRI elem);
        boolean user_check_remove(org.xowl.infra.lang.owl2.IRI elem);
        boolean user_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem);
        void user_add(org.xowl.infra.lang.owl2.IRI elem);
        void user_remove(org.xowl.infra.lang.owl2.IRI elem);
        boolean inverse_check_add(org.xowl.infra.lang.owl2.IRI elem);
        boolean inverse_check_remove(org.xowl.infra.lang.owl2.IRI elem);
        boolean inverse_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem);
        void inverse_add(org.xowl.infra.lang.owl2.IRI elem);
        void inverse_remove(org.xowl.infra.lang.owl2.IRI elem);
    }
    private static class constrainingFacet_impl implements org.xowl.infra.lang.owl2.FacetRestriction.constrainingFacet {
        private org.xowl.infra.lang.owl2.FacetRestriction domain;
        private org.xowl.infra.lang.owl2.IRI data;
        public org.xowl.infra.lang.owl2.IRI get_raw() { return data; }
        public org.xowl.infra.lang.owl2.IRI 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.IRI elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.owl2.IRI 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.IRI 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.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.owl2.IRI elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.owl2.IRI elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.owl2.IRI elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.owl2.IRI elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.owl2.IRI elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.owl2.IRI elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.owl2.IRI elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.owl2.IRI elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.owl2.IRI elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.owl2.IRI elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.owl2.IRI oldElem, org.xowl.infra.lang.owl2.IRI  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.owl2.IRI elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.owl2.IRI elem) {
            tree_remove(elem);
        }
        public constrainingFacet_impl(org.xowl.infra.lang.owl2.FacetRestriction domain) {
            this.domain = domain;
        }
    }
    private constrainingFacet_impl dataConstrainingFacet;
    public org.xowl.infra.lang.owl2.FacetRestriction.constrainingFacet __getImplOfconstrainingFacet() { return dataConstrainingFacet; }
    public boolean setConstrainingFacet(org.xowl.infra.lang.owl2.IRI elem) {
        if (dataConstrainingFacet.get() != null) {
            if (elem == null) {
                if (!dataConstrainingFacet.user_check_remove(dataConstrainingFacet.get())) return false;
                dataConstrainingFacet.user_remove(dataConstrainingFacet.get());
            } else {
                if (!dataConstrainingFacet.user_check_replace(dataConstrainingFacet.get(), elem)) return false;
                dataConstrainingFacet.user_remove(dataConstrainingFacet.get());
                dataConstrainingFacet.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataConstrainingFacet.user_check_add(elem)) return false;
            dataConstrainingFacet.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.owl2.IRI getConstrainingFacet() { return dataConstrainingFacet.get(); }
    // 

    public FacetRestriction() {
        dataConstrainingValue = new constrainingValue_impl(this);
        dataConstrainingFacet = new constrainingFacet_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy