Example #1
0
        override public void register(Context context)
        {
            Context actual = context.contextForValue(name);

            if (actual == context)
            {
                throw new SyntaxError("Duplicate argument: \"" + name + "\"");
            }
            resolve(context);
            if (resolved == type)
            {
                context.registerValue(this);
            }
            else
            {
                CategoryParameter param = new CategoryParameter(resolved, name);
                param.setMutable(mutable);
                context.registerValue(param);
            }
            if (DefaultValue != null)
            {
                IValue value = DefaultValue.interpret(context);
                context.setValue(name, value);
            }
        }
Example #2
0
        override public bool Equals(Object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is CategoryParameter))
            {
                return(false);
            }
            CategoryParameter other = (CategoryParameter)obj;

            return(ObjectUtils.AreEqual(this.getType(), other.getType()) &&
                   ObjectUtils.AreEqual(this.GetName(), other.GetName()));
        }