Example #1
0
 public Scalar(Scalar other)
     : base(other)
 {
     _defaultValue = (ScalarValue) other._defaultValue.Clone();
     _fastType = other._fastType;
     _initialValue = (ScalarValue) other._initialValue.Clone();
     _operator = other._operator;
     _operatorCodec = other._operatorCodec;
     _typeCodec = other._typeCodec;
     _dictionary = other._dictionary;
 }
Example #2
0
 private Scalar(QName name, FastType fastType, Operator op, OperatorCodec operatorCodec,
                ScalarValue defaultValue, bool optional)
     : base(name, optional)
 {
     _operator = op;
     _operatorCodec = operatorCodec;
     _dictionary = DictionaryFields.Global;
     _defaultValue = defaultValue ?? ScalarValue.Undefined;
     _fastType = fastType;
     _typeCodec = fastType.GetCodec(op, optional);
     _initialValue = (defaultValue == null || defaultValue.IsUndefined) ? _fastType.DefaultValue : defaultValue;
     op.Validate(this);
 }
Example #3
0
 public virtual OperatorCodec GetCodec(FastType type)
 {
     return(OperatorCodec.GetCodec(this, type));
 }
Example #4
0
 public Scalar(QName name, FastType fastType, OperatorCodec operatorCodec, ScalarValue defaultValue,
               bool optional)
     : this(name, fastType, operatorCodec.Operator, operatorCodec, defaultValue, optional)
 {
 }
 protected static void AssertScalarField(IFieldSet fieldSet, int fieldIndex, FastType type, String name,
                                         OperatorCodec operatorCodec,
                                         ScalarValue defaultValue)
 {
     var field = (Scalar) fieldSet.GetField(fieldIndex);
     AssertScalarField(field, type, name);
     Assert.AreEqual(operatorCodec, field.OperatorCodec);
     Assert.AreEqual(defaultValue, field.DefaultValue);
 }