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

io.ciera.tool.sql.ooaofooa.component.impl.C_IImpl Maven / Gradle / Ivy

There is a newer version: 2.7.3
Show newest version
package io.ciera.tool.sql.ooaofooa.component.impl;


import io.ciera.runtime.instanceloading.AttributeChangedDelta;
import io.ciera.runtime.instanceloading.InstanceCreatedDelta;
import io.ciera.runtime.summit.application.IRunContext;
import io.ciera.runtime.summit.classes.IInstanceIdentifier;
import io.ciera.runtime.summit.classes.InstanceIdentifier;
import io.ciera.runtime.summit.classes.ModelInstance;
import io.ciera.runtime.summit.exceptions.EmptyInstanceException;
import io.ciera.runtime.summit.exceptions.InstancePopulationException;
import io.ciera.runtime.summit.exceptions.XtumlException;
import io.ciera.runtime.summit.types.IWhere;
import io.ciera.runtime.summit.types.IXtumlType;
import io.ciera.runtime.summit.types.StringUtil;
import io.ciera.runtime.summit.types.UniqueId;
import io.ciera.tool.Sql;
import io.ciera.tool.sql.architecture.interfaces.Iface;
import io.ciera.tool.sql.architecture.interfaces.impl.IfaceImpl;
import io.ciera.tool.sql.ooaofooa.component.C_I;
import io.ciera.tool.sql.ooaofooa.component.ExecutableProperty;
import io.ciera.tool.sql.ooaofooa.component.ExecutablePropertySet;
import io.ciera.tool.sql.ooaofooa.component.InterfaceReference;
import io.ciera.tool.sql.ooaofooa.component.InterfaceReferenceSet;
import io.ciera.tool.sql.ooaofooa.component.impl.ExecutablePropertySetImpl;
import io.ciera.tool.sql.ooaofooa.component.impl.InterfaceReferenceSetImpl;
import io.ciera.tool.sql.ooaofooa.packageableelement.PackageableElement;
import io.ciera.tool.sql.ooaofooa.packageableelement.impl.PackageableElementImpl;


public class C_IImpl extends ModelInstance implements C_I {

    public static final String KEY_LETTERS = "C_I";
    public static final C_I EMPTY_C_I = new EmptyC_I();

    private Sql context;

    // constructors
    private C_IImpl( Sql context ) {
        this.context = context;
        ref_Id = UniqueId.random();
        m_Package_IDdeprecated = UniqueId.random();
        m_Name = "";
        m_Descrip = "";
        R4003_is_defined_by_ExecutableProperty_set = new ExecutablePropertySetImpl();
        R4012_is_formal_definition_InterfaceReference_set = new InterfaceReferenceSetImpl();
        R421_Iface_inst = IfaceImpl.EMPTY_IFACE;
        R8001_is_a_PackageableElement_inst = PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
    }

    private C_IImpl( Sql context, UniqueId instanceId, UniqueId ref_Id, UniqueId m_Package_IDdeprecated, String m_Name, String m_Descrip ) {
        super(instanceId);
        this.context = context;
        this.ref_Id = ref_Id;
        this.m_Package_IDdeprecated = m_Package_IDdeprecated;
        this.m_Name = m_Name;
        this.m_Descrip = m_Descrip;
        R4003_is_defined_by_ExecutableProperty_set = new ExecutablePropertySetImpl();
        R4012_is_formal_definition_InterfaceReference_set = new InterfaceReferenceSetImpl();
        R421_Iface_inst = IfaceImpl.EMPTY_IFACE;
        R8001_is_a_PackageableElement_inst = PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
    }

    public static C_I create( Sql context ) throws XtumlException {
        C_I newC_I = new C_IImpl( context );
        if ( context.addInstance( newC_I ) ) {
            newC_I.getRunContext().addChange(new InstanceCreatedDelta(newC_I, KEY_LETTERS));
            return newC_I;
        }
        else throw new InstancePopulationException( "Instance already exists within this population." );
    }

    public static C_I create( Sql context, UniqueId ref_Id, UniqueId m_Package_IDdeprecated, String m_Name, String m_Descrip ) throws XtumlException {
        return create(context, UniqueId.random(), ref_Id, m_Package_IDdeprecated, m_Name, m_Descrip);
    }

    public static C_I create( Sql context, UniqueId instanceId, UniqueId ref_Id, UniqueId m_Package_IDdeprecated, String m_Name, String m_Descrip ) throws XtumlException {
        C_I newC_I = new C_IImpl( context, instanceId, ref_Id, m_Package_IDdeprecated, m_Name, m_Descrip );
        if ( context.addInstance( newC_I ) ) {
            return newC_I;
        }
        else throw new InstancePopulationException( "Instance already exists within this population." );
    }



    // attributes
    private UniqueId ref_Id;
    @Override
    public void setId(UniqueId ref_Id) throws XtumlException {
        checkLiving();
        if (ref_Id.inequality( this.ref_Id)) {
            final UniqueId oldValue = this.ref_Id;
            this.ref_Id = ref_Id;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Id", oldValue, this.ref_Id));
            if ( !R4012_is_formal_definition_InterfaceReference().isEmpty() ) R4012_is_formal_definition_InterfaceReference().setFormal_Interface_Id( ref_Id );
            if ( !R4003_is_defined_by_ExecutableProperty().isEmpty() ) R4003_is_defined_by_ExecutableProperty().setInterface_Id( ref_Id );
        }
    }
    @Override
    public UniqueId getId() throws XtumlException {
        checkLiving();
        return ref_Id;
    }
    private UniqueId m_Package_IDdeprecated;
    @Override
    public UniqueId getPackage_IDdeprecated() throws XtumlException {
        checkLiving();
        return m_Package_IDdeprecated;
    }
    @Override
    public void setPackage_IDdeprecated(UniqueId m_Package_IDdeprecated) throws XtumlException {
        checkLiving();
        if (m_Package_IDdeprecated.inequality( this.m_Package_IDdeprecated)) {
            final UniqueId oldValue = this.m_Package_IDdeprecated;
            this.m_Package_IDdeprecated = m_Package_IDdeprecated;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "m_Package_IDdeprecated", oldValue, this.m_Package_IDdeprecated));
        }
    }
    private String m_Name;
    @Override
    public String getName() throws XtumlException {
        checkLiving();
        return m_Name;
    }
    @Override
    public void setName(String m_Name) throws XtumlException {
        checkLiving();
        if (StringUtil.inequality(m_Name, this.m_Name)) {
            final String oldValue = this.m_Name;
            this.m_Name = m_Name;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "m_Name", oldValue, this.m_Name));
        }
    }
    private String m_Descrip;
    @Override
    public void setDescrip(String m_Descrip) throws XtumlException {
        checkLiving();
        if (StringUtil.inequality(m_Descrip, this.m_Descrip)) {
            final String oldValue = this.m_Descrip;
            this.m_Descrip = m_Descrip;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "m_Descrip", oldValue, this.m_Descrip));
        }
    }
    @Override
    public String getDescrip() throws XtumlException {
        checkLiving();
        return m_Descrip;
    }


    // instance identifiers
    @Override
    public IInstanceIdentifier getId1() {
        try {
            return new InstanceIdentifier(getId());
        }
        catch ( XtumlException e ) {
            getRunContext().getLog().error(e);
            System.exit(1);
            return null;
        }
    }

    // operations


    // static operations


    // events


    // selections
    private ExecutablePropertySet R4003_is_defined_by_ExecutableProperty_set;
    @Override
    public void addR4003_is_defined_by_ExecutableProperty( ExecutableProperty inst ) {
        R4003_is_defined_by_ExecutableProperty_set.add(inst);
    }
    @Override
    public void removeR4003_is_defined_by_ExecutableProperty( ExecutableProperty inst ) {
        R4003_is_defined_by_ExecutableProperty_set.remove(inst);
    }
    @Override
    public ExecutablePropertySet R4003_is_defined_by_ExecutableProperty() throws XtumlException {
        return R4003_is_defined_by_ExecutableProperty_set;
    }
    private InterfaceReferenceSet R4012_is_formal_definition_InterfaceReference_set;
    @Override
    public void addR4012_is_formal_definition_InterfaceReference( InterfaceReference inst ) {
        R4012_is_formal_definition_InterfaceReference_set.add(inst);
    }
    @Override
    public void removeR4012_is_formal_definition_InterfaceReference( InterfaceReference inst ) {
        R4012_is_formal_definition_InterfaceReference_set.remove(inst);
    }
    @Override
    public InterfaceReferenceSet R4012_is_formal_definition_InterfaceReference() throws XtumlException {
        return R4012_is_formal_definition_InterfaceReference_set;
    }
    private Iface R421_Iface_inst;
    @Override
    public void setR421_Iface( Iface inst ) {
        R421_Iface_inst = inst;
    }
    @Override
    public Iface R421_Iface() throws XtumlException {
        return R421_Iface_inst;
    }
    private PackageableElement R8001_is_a_PackageableElement_inst;
    @Override
    public void setR8001_is_a_PackageableElement( PackageableElement inst ) {
        R8001_is_a_PackageableElement_inst = inst;
    }
    @Override
    public PackageableElement R8001_is_a_PackageableElement() throws XtumlException {
        return R8001_is_a_PackageableElement_inst;
    }


    @Override
    public IRunContext getRunContext() {
        return context().getRunContext();
    }

    @Override
    public Sql context() {
        return context;
    }

    @Override
    public String getKeyLetters() {
        return KEY_LETTERS;
    }

    @Override
    public C_I self() {
        return this;
    }

    @Override
    public C_I oneWhere(IWhere condition) throws XtumlException {
        if (null == condition) throw new XtumlException("Null condition passed to selection.");
        if (condition.evaluate(this)) return this;
        else return EMPTY_C_I;
    }

}

class EmptyC_I extends ModelInstance implements C_I {

    // attributes
    public void setId( UniqueId ref_Id ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public UniqueId getId() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public UniqueId getPackage_IDdeprecated() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public void setPackage_IDdeprecated( UniqueId m_Package_IDdeprecated ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public String getName() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public void setName( String m_Name ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public void setDescrip( String m_Descrip ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public String getDescrip() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }


    // operations


    // selections
    @Override
    public ExecutablePropertySet R4003_is_defined_by_ExecutableProperty() {
        return (new ExecutablePropertySetImpl());
    }
    @Override
    public InterfaceReferenceSet R4012_is_formal_definition_InterfaceReference() {
        return (new InterfaceReferenceSetImpl());
    }
    @Override
    public Iface R421_Iface() {
        return IfaceImpl.EMPTY_IFACE;
    }
    @Override
    public PackageableElement R8001_is_a_PackageableElement() {
        return PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
    }


    @Override
    public String getKeyLetters() {
        return C_IImpl.KEY_LETTERS;
    }

    @Override
    public C_I self() {
        return this;
    }

    @Override
    public boolean isEmpty() {
        return true;
    }

    @Override
    public C_I oneWhere(IWhere condition) throws XtumlException {
        if (null == condition) throw new XtumlException("Null condition passed to selection.");
        return C_IImpl.EMPTY_C_I;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy