namespace HeuristicLab.BenchmarkSuite.Views { public static class ViewHelper { public static string StringifyInput(ExampleArgumentType type, Example example, string valueSeparator) { switch (type) { case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.InputInteger); //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.InputInteger); case ExampleArgumentType.Float: return string.Join(valueSeparator, example.InputFloat); //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.InputFloat); case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.InputBoolean); case ExampleArgumentType.Char: return string.Join(valueSeparator, example.InputChar); case ExampleArgumentType.String: return string.Join(valueSeparator, example.InputString); //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.InputString); default: return string.Empty; } } public static string StringifyOutput(ExampleArgumentType type, Example example, string valueSeparator) { switch (type) { case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.OutputInteger); //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.OutputIntegerVector); case ExampleArgumentType.Float: return string.Join(valueSeparator, example.OutputFloat); //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.OutputFloat); case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.OutputBoolean); case ExampleArgumentType.Char: return string.Join(valueSeparator, example.OutputChar); case ExampleArgumentType.String: return string.Join(valueSeparator, example.OutputString); //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.OutputString); default: return string.Empty; } } private const string IntegerColumnHeader = "int"; private const string IntegersColumnHeader = "int[]"; private const string DoubleColumnHeader = "float"; private const string DoublesColumnHeader = "float[]"; private const string BooleanColumnHeader = "bool"; private const string CharColumnHeader = "char"; private const string StringColumnHeader = "string"; private const string StringsColumnHeader = "string[]"; public static string GetHeaderTypeName(ExampleArgumentType type) { switch (type) { case ExampleArgumentType.Integer: return IntegerColumnHeader; case ExampleArgumentType.Float: return DoubleColumnHeader; case ExampleArgumentType.Boolean: return BooleanColumnHeader; case ExampleArgumentType.Char: return CharColumnHeader; case ExampleArgumentType.String: return StringColumnHeader; case ExampleArgumentType.IntegerVector: return IntegersColumnHeader; case ExampleArgumentType.FloatVector: return DoublesColumnHeader; case ExampleArgumentType.StringVector: return StringsColumnHeader; default: return string.Empty; } } } }