Пример #1
0
        //Default Parameters opposite = null ,ValueSpecification def= ,null,DomainSpecification domain=null
        public Property(string name, Class cl, Classifier type, Property opposite, ValueSpecification def, DomainSpecification domain)
            : base(name)
        {
            this.type          = type;
            this.classifier    = cl;
            this.opposite      = opposite;
            this.defaultValue  = null;
            this.domain        = domain;
            this.isComposite   = false;
            this.isNavigable   = false;
            this.isReadOnly    = false;
            this.isDerived     = false;
            this.isUnique      = false;
            this.isOrdered     = false;
            this.minimumNumber = 0;
            this.maximumNumber = 1;

            if (def != null)
            {
                this.defaultValue = def;
            }
            else
            {
                string typeName = type.name;
                if (typeName == "real")
                {
                    this.defaultValue = new LiteralReal();
                }
                else if (typeName == "integer")
                {
                    this.defaultValue = new LiteralInteger();
                }
                else if (typeName == "string")
                {
                    this.defaultValue = new LiteralString();
                }
                else if (typeName == "boolean")
                {
                    this.defaultValue = new LiteralBoolean();
                }
                else if (typeName == "bool")
                {
                    this.defaultValue = new LiteralBoolean();
                }
            }
        }
Пример #2
0
        //Default Parameters opposite = null ,ValueSpecification def= ,null,DomainSpecification domain=null
        public Property(string name, Class cl, Classifier type, Property opposite, ValueSpecification def, DomainSpecification domain)
            : base(name)
        {
            this.type = type;
            this.classifier = cl;
            this.opposite = opposite;
            this.defaultValue = null;
            this.domain = domain;
            this.isComposite = false;
            this.isNavigable = false;
            this.isReadOnly = false;
            this.isDerived = false;
            this.isUnique = false;
            this.isOrdered = false;
            this.minimumNumber = 0;
            this.maximumNumber = 1;

            if (def != null)
                this.defaultValue = def;
            else
            {
                string typeName = type.name;
                if (typeName == "real")
                {
                    this.defaultValue = new LiteralReal();
                }
                else if (typeName == "integer")
                {
                    this.defaultValue = new LiteralInteger();
                }
                else if (typeName == "string")
                {
                    this.defaultValue = new LiteralString();
                }
                else if (typeName == "boolean")
                {
                    this.defaultValue = new LiteralBoolean();
                }
                else if (typeName == "bool")
                {
                    this.defaultValue = new LiteralBoolean();
                }
            }
        }
Пример #3
0
 public FlowPort(string name, Class cl, Classifier type, Property opposite, ValueSpecification def, DomainSpecification domain) :
     base(name, cl, type, opposite, def, domain)
 {
 }
Пример #4
0
 public Port(string name, Class cl, Classifier type, Property opposite, ValueSpecification def, DomainSpecification domain)
     : base(name, cl, type, opposite, def, domain)
 {
 }