public ITimeSpaceValueSet GetValues(IBaseExchangeItem querySpecifier)
        {
            ITimeSpaceExchangeItem timeSpaceQuery = querySpecifier as ITimeSpaceExchangeItem;

            if (timeSpaceQuery == null)
            {
                throw new ArgumentException("Must be an ITimeSpaceExchangeItem, add an adaptor", "querySpecifier");
            }

            if (_children.Count == 0)
            {
                return(null); // TODO: Or throw an exception?
            }
            TimeSpaceValueSet <double> resultSet = ElementMapper.CreateResultValueSet(timeSpaceQuery.TimeSet.Times.Count, this.ElementSet().ElementCount);

            // Get values from all adaptees/children, and add them together
            for (int i = 0; i < _children.Count; i++)
            {
                ITimeSpaceOutputAdder addingChild = _children[i] as ITimeSpaceOutputAdder;
                if (addingChild != null)
                {
                    addingChild.GetValues(resultSet, querySpecifier);
                }
                else
                {
                    ITimeSpaceValueSet values = _children[i].GetValues(querySpecifier);
                    AddSourceToTarget(resultSet, values);
                }
            }
            return(resultSet);
        }
        public override ITimeSpaceValueSet GetValues(IBaseExchangeItem querySpecifier2)
        {
            ITimeSpaceExchangeItem timeSpaceQuery = querySpecifier2 as ITimeSpaceExchangeItem;

            if (timeSpaceQuery == null)
            {
                throw new ArgumentException("querySpecifier must be an ITimeSpaceExchangeItem - add an adaptor");
            }

            if (!(timeSpaceQuery is ITimeSpaceInput))
            {
                throw new OpenMIException("Get Values can only be called with an Input as argument")
                      {
                          Component = Adaptee.Component, Output = this
                      };
            }


            /// Using a _query item in the
            ///     _adaptee.GetValues(_query)
            /// instead of
            ///     _adaptee.GetValues(this)
            ///
            /// Reason:
            /// The latter would need to set internal
            ///     TimeSet = timeSpaceQuery.TimeSet;
            /// but then internal Values does not match TimeSet
            /// (and also the TimeSet is set to override and return _adaptee.TimeSet)

            // Before uncommenting this, comment out the overidden TimeSet property above
            //TimeSet = timeSpaceQuery.TimeSet;

            // Set query time to internal query item
            _query.TimeSet = timeSpaceQuery.TimeSet;

            ITimeSpaceValueSet         incomingValues = _adaptee.GetValues(_query);
            TimeSpaceValueSet <double> resultValues   = ElementMapper.CreateResultValueSet(incomingValues.TimesCount(), SpatialDefinition.ElementCount);

            // Transform the values from the adaptee
            _elementMapper.MapValues(resultValues, incomingValues);
            return(resultValues);
        }