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

org.xowl.infra.lang.runtime.DataAllValuesFrom 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 DataAllValuesFrom implements org.xowl.infra.lang.runtime.NAryDataPropertyRestriction {
    // 
    private static class datatype_impl implements org.xowl.infra.lang.runtime.DataCardinalityRestriction_OR_NAryDataPropertyRestriction.datatype {
        private org.xowl.infra.lang.runtime.DataAllValuesFrom domain;
        private org.xowl.infra.lang.runtime.Datatype data;
        public org.xowl.infra.lang.runtime.Datatype get_raw() { return data; }
        public org.xowl.infra.lang.runtime.Datatype 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.Datatype elem) { return (data == elem); }
        public boolean simple_check_add(org.xowl.infra.lang.runtime.Datatype 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.Datatype 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.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype  newElem) {
            if (check_contains(newElem)) return false;
            if (!check_contains(oldElem)) return false;
            return true;
        }
        public void simple_add(org.xowl.infra.lang.runtime.Datatype elem) {
            data = elem;
        }
        public void simple_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            data = null;
        }
        private boolean tree_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
            if (!simple_check_add(elem)) return false;
            return true;
        }
        private boolean tree_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            if (!simple_check_remove(elem)) return false;
            return true;
        }
        private boolean tree_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype  newElem) {
            if (!simple_check_replace(oldElem, newElem)) return false;
            return true;
        }
        private void tree_add(org.xowl.infra.lang.runtime.Datatype elem) {
            simple_add(elem);
        }
        private void tree_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            simple_remove(elem);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean user_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void user_add(org.xowl.infra.lang.runtime.Datatype elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.Datatype elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            return tree_check_remove(elem);
        }
        @Override public boolean inverse_check_replace(org.xowl.infra.lang.runtime.Datatype oldElem, org.xowl.infra.lang.runtime.Datatype  newElem) {
            return tree_check_replace(oldElem, newElem);
        }
        @Override public void inverse_add(org.xowl.infra.lang.runtime.Datatype elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.runtime.Datatype elem) {
            tree_remove(elem);
        }
        public datatype_impl(org.xowl.infra.lang.runtime.DataAllValuesFrom domain) {
            this.domain = domain;
        }
    }
    private datatype_impl dataDatatype;
    public org.xowl.infra.lang.runtime.DataCardinalityRestriction_OR_NAryDataPropertyRestriction.datatype __getImplOfdatatype() { return dataDatatype; }
    public boolean setDatatype(org.xowl.infra.lang.runtime.Datatype elem) {
        if (dataDatatype.get() != null) {
            if (elem == null) {
                if (!dataDatatype.user_check_remove(dataDatatype.get())) return false;
                dataDatatype.user_remove(dataDatatype.get());
            } else {
                if (!dataDatatype.user_check_replace(dataDatatype.get(), elem)) return false;
                dataDatatype.user_remove(dataDatatype.get());
                dataDatatype.user_add(elem);
            }
        } else {
            if (elem == null) return true;
            if (!dataDatatype.user_check_add(elem)) return false;
            dataDatatype.user_add(elem);
        }
        return true;
    }
    public org.xowl.infra.lang.runtime.Datatype getDatatype() { return dataDatatype.get(); }
    // 

    // 
    private static class dataProperties_impl implements org.xowl.infra.lang.runtime.NAryDataPropertyRestriction.dataProperties {
        private org.xowl.infra.lang.runtime.DataAllValuesFrom domain;
        private java.util.List data;
        public java.util.Collection get_raw() { return new java.util.ArrayList(data); }
        public java.util.Collection get() { return new java.util.ArrayList(data); }
        private boolean check_card(int modifier) {
            int card = data.size() + 0 + modifier;
            return (card >= 0 && card <= 2147483647);
        }
        @Override public boolean check_contains(org.xowl.infra.lang.runtime.DataProperty elem) { return (data.contains(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.add(elem);
        }
        public void simple_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
            data.remove(elem);
        }
        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);
        }
        @Override public boolean user_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
            return tree_check_add(elem);
        }
        @Override public boolean user_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
            return tree_check_remove(elem);
        }
        @Override 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);
        }
        @Override public void user_add(org.xowl.infra.lang.runtime.DataProperty elem) {
            tree_add(elem);
        }
        @Override public void user_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
            tree_remove(elem);
        }
        @Override public boolean inverse_check_add(org.xowl.infra.lang.runtime.DataProperty elem) {
            return tree_check_add(elem);
        }
        @Override public boolean inverse_check_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
            return tree_check_remove(elem);
        }
        @Override 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);
        }
        @Override public void inverse_add(org.xowl.infra.lang.runtime.DataProperty elem) {
            tree_add(elem);
        }
        @Override public void inverse_remove(org.xowl.infra.lang.runtime.DataProperty elem) {
            tree_remove(elem);
        }
        public dataProperties_impl(org.xowl.infra.lang.runtime.DataAllValuesFrom domain) {
            this.domain = domain;
            this.data = new java.util.ArrayList();
        }
    }
    private dataProperties_impl dataDataProperties;
    public org.xowl.infra.lang.runtime.NAryDataPropertyRestriction.dataProperties __getImplOfdataProperties() { return dataDataProperties; }
    public boolean addDataProperties(org.xowl.infra.lang.runtime.DataProperty elem) {
        if (!dataDataProperties.user_check_add(elem)) return false;
        dataDataProperties.user_add(elem);
        return true;
    }
    public boolean removeDataProperties(org.xowl.infra.lang.runtime.DataProperty elem) {
        if (!dataDataProperties.user_check_remove(elem)) return false;
        dataDataProperties.user_remove(elem);
        return true;
    }
    public java.util.Collection getAllDataProperties() { return dataDataProperties.get(); }
    // 

    public DataAllValuesFrom() {
        dataDatatype = new datatype_impl(this);
        dataDataProperties = new dataProperties_impl(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy