コード例 #1
0
	    public ComplexComponentValueImpl(string value, TextSearch textOperator, SdmxStructureEnumType componentType)
        {
		    if(componentType.Equals(SdmxStructureEnumType.Dimension) || componentType.Equals(SdmxStructureEnumType.TimeDimension)) 
			    throw new SdmxSemmanticException(ExceptionCode.QuerySelectionIllegalOperator);
		
		    this._value = value;
		    if (textOperator != null)
			    this._textOperator = textOperator;
		    else
			    this._textOperator = TextSearch.GetFromEnum(TextSearchEnumType.Equal);
	    }
コード例 #2
0
	    public ComplexComponentValueImpl(string value, OrderedOperator orderedOperator,  SdmxStructureEnumType componentType)
        {
		    if (componentType.Equals(SdmxStructureEnumType.TimeDimension) && orderedOperator.Equals(OrderedOperatorEnumType.NotEqual))
			    throw new SdmxSemmanticException(ExceptionCode.QuerySelectionIllegalOperator);

		    this._value =value;
		    if (orderedOperator!=null)
			    this._orderedOperator = orderedOperator;
		    else
			    this._orderedOperator = OrderedOperator.GetFromEnum(OrderedOperatorEnumType.Equal);
	    }
        /// <summary>
        /// Parses the value types of the incoming component value type, and returns the complex component value to construct in the selection.
        /// </summary>
        /// <param name="compValue">
        /// The component value.
        /// </param>
        /// <param name="compType">
        /// The component type : either a dimension, time dimension, attribute or primary measure.
        /// </param>
        /// <returns>
        /// The set with the ComplexCompoentValue objects.
        /// </returns>
        private IList<IComplexComponentValue> GetComplexComponentValues(DataStructureComponentValueQueryType compValue, SdmxStructureEnumType compType)
        {
            IList<IComplexComponentValue> comValues = new List<IComplexComponentValue>();
            IComplexComponentValue comValue = null;

            //Numeric Values
            if (compValue.NumericValue != null)
            {
                foreach (NumericValue numerValue in compValue.NumericValue)
                {
                    OrderedOperator orderedOperator = OrderedOperator.ParseString([email protected]());
                    comValue = new ComplexComponentValueImpl(numerValue.TypedValue.ToString(CultureInfo.InvariantCulture), orderedOperator, compType);
                    comValues.Add(comValue);
                }
            }

            //Time Value
            if (compValue.TimeValue != null)
            {
                foreach (TimeValue timeValue in compValue.TimeValue)
                {
                    OrderedOperator orderedOperator = OrderedOperator.ParseString([email protected]());
                    comValue = new ComplexComponentValueImpl(timeValue.TypedValue.ToString(), orderedOperator, compType);
                    comValues.Add(comValue);
                }
            }

            //Text Value applicable only for attribute and primary measure
            if (compType.Equals(SdmxStructureEnumType.PrimaryMeasure) || compType.Equals(SdmxStructureEnumType.DataAttribute))
            {
                //It's a generic type but the type will always be one
                if (compValue.TextValue != null)
                {
                    foreach (TextValue textValue in compValue.TextValue)
                    {
                        TextSearch textOperator = TextSearch.ParseString([email protected]());
                        comValue = new ComplexComponentValueImpl(textValue.ToString(), textOperator, compType);
                        comValues.Add(comValue);
                    }
                }
            }

            //Value
            if (compValue.Value != null)
            {
                OrderedOperator orderedOperator = OrderedOperator.ParseString([email protected]());
                comValue = new ComplexComponentValueImpl(compValue.Value.ToString(), orderedOperator, compType);
                comValues.Add(comValue);
            }

            return comValues;
        }