public static OlapDimensionsTree BuildDimensionsTree(TempTable olapStage, string[] columns) { LinkedList<KeyValuePair<string, string>> filters = new LinkedList<KeyValuePair<string, string>>(); OlapDimensionsTree root = new OlapDimensionsTree(); BuildTreeRecursive(olapStage, root, filters, columns, 0); root.CalculateWeight(); return root; }
public OlapDimensionsTree(string name, string value, OlapDimensionsTree parent) { this.name = name; this.value = value; this.children = new List<OlapDimensionsTree>(); this.weight = 1; this.parent = parent; }
// todo: remove recursion private static void BuildTreeRecursive(TempTable olapStage, OlapDimensionsTree root, LinkedList<KeyValuePair<string, string>> filters, string[] columns, int index) { if (index == columns.Length) return; string col = columns[index]; foreach (string value in olapStage.GetColumnValues(col, filters)) { OlapDimensionsTree node = new OlapDimensionsTree(col, value, root); root.children.Add(node); filters.AddLast(new LinkedListNode<KeyValuePair<string, string>>(new KeyValuePair<string, string>(col, value))); BuildTreeRecursive(olapStage, node, filters, columns, index + 1); filters.RemoveLast(); } }
public OlapCellInfo(OlapDimensionsTree leftFilters, OlapDimensionsTree topFilters) { LeftFilters = leftFilters; TopFilters = topFilters; }