using System;
using Toolbox.Docking.Api.Units;

namespace Toolbox.Docking.Api.Data
{
    /// <summary>
    /// This class represents a Toolbox data value.
    /// </summary>
    [Serializable]
    public sealed class TbData: TbScalarData
    {
        /// <summary>
        /// Data constructor from TbScalarData.
        /// </summary>
        /// <param name="scalarData">Scalar to be copied from.</param>
        public TbData(TbScalarData scalarData) : base(scalarData)
        {

        }

        /// <summary>
        /// Toolbox data value description object constructor.
        /// </summary>
        /// <param name="unit">The Toolbox unit for the data value.</param>
        /// <param name="value">
        /// The corresponding value. The value is <b>nullable</b> to account for the
        /// case when the unit contains the actual value i.e. contains a categorical data 
        /// in its FamilyName (e.g. <b>Mutagenicity</b>) and Unit (e.g. <b>Positive</b>)
        /// </param>
        public TbData(TbUnit unit, double? value) : base(unit, value)
        {

        }
        /// <summary>
        /// Toolbox data value description object constructor.
        /// </summary>
        /// <param name="unit">The Toolbox unit for the data value.</param>
        /// <param name="value">
        /// The corresponding value. The value is <b>nullable</b> to account for the
        /// case when the unit contains the actual value i.e. contains a categorical data 
        /// in its FamilyName (e.g. <b>Mutagenicity</b>) and Unit (e.g. <b>Positive</b>).
        /// </param>
        /// <param name="qualifier">
        /// Qualifier for the value.
        /// </param>
        public TbData(TbUnit unit, double? value, TbDataQualifier qualifier) :
            base(unit, value, qualifier)
        {

        }
        /// <summary>
        /// Toolbox data value description object constructor. 
        /// </summary>
        /// <param name="unit">The Toolbox unit for the data value.</param>
        /// <param name="value">Mean value.</param>
        /// <param name="qualifier">Qualifier for the mean value.</param>
        /// <param name="minValue">Min value for the range.</param>
        /// <param name="minQualifier">Min value qualifier.</param>
        /// <param name="maxValue">Max value for the range.</param>
        /// <param name="maxQualifier">Max value qualifier.</param>
        public TbData(TbUnit unit, double? value, TbDataQualifier qualifier, double? minValue, TbDataQualifier minQualifier,
            double? maxValue, TbDataQualifier maxQualifier): base(unit, value, qualifier)
        {
            MinValue = minValue;
            MinQualifier = minQualifier;
            MaxValue = maxValue;
            MaxQualifier = maxQualifier;
        }
        /// <summary>
        /// Min value for the range.
        /// </summary>
        public double? MinValue { get; }
        /// <summary>
        /// Min value qualifier.
        /// </summary>
        public TbDataQualifier MinQualifier { get; }
        /// <summary>
        /// Max value for the range.
        /// </summary>
        public double? MaxValue { get; }
        /// <summary>
        /// Max value for the range.
        /// </summary>
        public TbDataQualifier MaxQualifier { get; }
    }
}