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

org.xowl.infra.lang.runtime.Function 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 Function implements org.xowl.infra.lang.runtime.Interpretation {
    // 
    private static class interpretationOf_impl implements org.xowl.infra.lang.runtime.Interpretation.interpretationOf {
        private org.xowl.infra.lang.runtime.Function domain;
        private org.xowl.infra.lang.runtime.Entity data;
        public org.xowl.infra.lang.runtime.Entity get_raw() { return data; }
        public org.xowl.infra.lang.runtime.Entity 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.Entity elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.runtime.Entity 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.Entity 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.Entity oldElem, org.xowl.infra.lang.runtime.Entity  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.runtime.Entity elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.runtime.Entity elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.runtime.Entity elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.runtime.Entity elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.runtime.Entity oldElem, org.xowl.infra.lang.runtime.Entity  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.runtime.Entity elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.runtime.Entity elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.runtime.Entity elem) {
            if (!elem.__getImplOfinterpretedAs().inverse_check_add(domain)) return false;
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Entity elem) {
            if (!elem.__getImplOfinterpretedAs().inverse_check_remove(domain)) return false;
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Entity oldElem, org.xowl.infra.lang.runtime.Entity  newElem) {
            if (!oldElem.__getImplOfinterpretedAs().inverse_check_remove(domain)) return false;
            if (!newElem.__getImplOfinterpretedAs().inverse_check_add(domain)) return false;
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.runtime.Entity elem) {
            elem.__getImplOfinterpretedAs().inverse_add(domain);
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.runtime.Entity elem) {
            elem.__getImplOfinterpretedAs().inverse_remove(domain);
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Entity elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Entity elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Entity oldElem, org.xowl.infra.lang.runtime.Entity  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.runtime.Entity elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.runtime.Entity elem) {
            tree_remove(elem);
        }
        public interpretationOf_impl(org.xowl.infra.lang.runtime.Function domain) {
            this.domain = domain;
        }
    }
    private interpretationOf_impl dataInterpretationOf;
    public org.xowl.infra.lang.runtime.Interpretation.interpretationOf __getImplOfinterpretationOf() { return dataInterpretationOf; }
    public boolean setInterpretationOf(org.xowl.infra.lang.runtime.Entity elem) {
        if (dataInterpretationOf.get() != null) {
            if (elem == null) {
                if (!dataInterpretationOf.user_check_remove(dataInterpretationOf.get())) return false;
                dataInterpretationOf.user_remove(dataInterpretationOf.get());
            } else {
                if (!dataInterpretationOf.user_check_replace(dataInterpretationOf.get(), elem)) return false;
                dataInterpretationOf.user_remove(dataInterpretationOf.get());
                dataInterpretationOf.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataInterpretationOf.user_check_add(elem)) return false;
            dataInterpretationOf.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Entity getInterpretationOf() { return dataInterpretationOf.get(); }
    // 

    // 
    public static interface definedAs {
        boolean check_contains(java.lang.Object elem);
        boolean user_check_add(java.lang.Object elem);
        boolean user_check_remove(java.lang.Object elem);
        boolean user_check_replace(java.lang.Object oldElem, java.lang.Object  newElem);
        void user_add(java.lang.Object elem);
        void user_remove(java.lang.Object elem);
        boolean inverse_check_add(java.lang.Object elem);
        boolean inverse_check_remove(java.lang.Object elem);
        boolean inverse_check_replace(java.lang.Object oldElem, java.lang.Object  newElem);
        void inverse_add(java.lang.Object elem);
        void inverse_remove(java.lang.Object elem);
    }
    private static class definedAs_impl implements org.xowl.infra.lang.runtime.Function.definedAs {
        private org.xowl.infra.lang.runtime.Function domain;
        private java.lang.Object data;
        public java.lang.Object get_raw() { return data; }
        public java.lang.Object 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.Object elem) { return (data == elem); }
        public boolean simple_check_add(java.lang.Object elem) {
            if (check_contains(elem)) return false;
            if (!check_card(1)) return false;
            return true;
        }
        public boolean simple_check_remove(java.lang.Object elem) {
            if (!check_contains(elem)) return false;
            if (!check_card(-1)) return false;
            return true;
        }
        public boolean simple_check_replace(java.lang.Object oldElem, java.lang.Object  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(java.lang.Object elem) {
            data = elem;
        }
        public void simple_remove(java.lang.Object elem) {
            data = null;
        }
        private boolean tree_check_add(java.lang.Object elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(java.lang.Object elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(java.lang.Object oldElem, java.lang.Object  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(java.lang.Object elem) {
            simple_add(elem);
        }
        private void tree_remove(java.lang.Object elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(java.lang.Object elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(java.lang.Object elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(java.lang.Object oldElem, java.lang.Object  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(java.lang.Object elem) {
            tree_add(elem);
        }
        @Override public void user_remove(java.lang.Object elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(java.lang.Object elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(java.lang.Object elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(java.lang.Object oldElem, java.lang.Object  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(java.lang.Object elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(java.lang.Object elem) {
            tree_remove(elem);
        }
        public definedAs_impl(org.xowl.infra.lang.runtime.Function domain) {
            this.domain = domain;
        }
    }
    private definedAs_impl dataDefinedAs;
    public org.xowl.infra.lang.runtime.Function.definedAs __getImplOfdefinedAs() { return dataDefinedAs; }
    public boolean setDefinedAs(java.lang.Object elem) {
        if (dataDefinedAs.get() != null) {
            if (elem == null) {
                if (!dataDefinedAs.user_check_remove(dataDefinedAs.get())) return false;
                dataDefinedAs.user_remove(dataDefinedAs.get());
            } else {
                if (!dataDefinedAs.user_check_replace(dataDefinedAs.get(), elem)) return false;
                dataDefinedAs.user_remove(dataDefinedAs.get());
                dataDefinedAs.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataDefinedAs.user_check_add(elem)) return false;
            dataDefinedAs.user_add(elem);
        }
        return true;
    }
    public java.lang.Object getDefinedAs() { return dataDefinedAs.get(); }
    // 

    public Function() {
        dataInterpretationOf = new interpretationOf_impl(this);
        dataDefinedAs = new definedAs_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy