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; }
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); }
protected SimpleType(string typeName, TypeCodec codec, TypeCodec nullableCodec) : base(typeName) { _codec = codec; _nullableCodec = nullableCodec; }
public StringType(string typeName, TypeCodec codec, TypeCodec nullableCodec) : base(typeName, codec, nullableCodec) { }
protected IntegerType(string typeName, long minValue, long maxValue, TypeCodec codec, TypeCodec nullableCodec) : base(typeName, codec, nullableCodec) { _minValue = minValue; _maxValue = maxValue; }
public UtfTypeString(string typeName, TypeCodec codec, TypeCodec nullableCodec) : base(typeName, codec, nullableCodec) { }
protected static void AssertEncodeDecode(ScalarValue value, String bitString, TypeCodec type) { Assert.AreEqual(ByteUtil.ConvertBitStringToFastByteArray(bitString), type.Encode(value ?? ScalarValue.Null)); Assert.AreEqual(value, type.Decode(ByteUtil.CreateByteStream(bitString))); }