Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 protected SimpleType(string typeName, TypeCodec codec, TypeCodec nullableCodec)
     : base(typeName)
 {
     _codec = codec;
     _nullableCodec = nullableCodec;
 }
Ejemplo n.º 4
0
 public StringType(string typeName, TypeCodec codec, TypeCodec nullableCodec)
     : base(typeName, codec, nullableCodec)
 {
 }
Ejemplo n.º 5
0
 protected IntegerType(string typeName, long minValue, long maxValue, TypeCodec codec, TypeCodec nullableCodec)
     : base(typeName, codec, nullableCodec)
 {
     _minValue = minValue;
     _maxValue = maxValue;
 }
Ejemplo n.º 6
0
 public UtfTypeString(string typeName, TypeCodec codec, TypeCodec nullableCodec)
     : base(typeName, codec, nullableCodec)
 {
 }
Ejemplo n.º 7
0
 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)));
 }