/// <summary> /// Expects a comma separated list (where the first element is the ratio /// (between 0 and 100)) and the second element is the distribution (if /// non-existent then uniform will be selected). /// </summary> /// <remarks> /// Expects a comma separated list (where the first element is the ratio /// (between 0 and 100)) and the second element is the distribution (if /// non-existent then uniform will be selected). If an empty list is passed in /// then this element will just set the distribution (to uniform) and leave the /// percent as null. /// </remarks> internal OperationData(string data) { string[] pieces = Helper.GetTrimmedStrings(data); distribution = Constants.Distribution.Uniform; percent = null; if (pieces.Length == 1) { percent = (double.ParseDouble(pieces[0]) / 100.0d); } else { if (pieces.Length >= 2) { percent = (double.ParseDouble(pieces[0]) / 100.0d); distribution = Constants.Distribution.ValueOf(StringUtils.ToUpperCase(pieces[1])); } } }
internal OperationData(Constants.Distribution d, double p) { this.distribution = d; this.percent = p; }