/// /// <summary> * get a reduced partionmap missing the keys in reduceKeys /// * </summary> /// * <param name="reduceKeys"> /// * @return </param> /// protected internal virtual VJDFAttributeMap getReducedMap(VString reduceKeys) { if (vParts == null) { return(null); } VJDFAttributeMap reducedMap = new VJDFAttributeMap(vParts); reducedMap.removeKeys(reduceKeys.getSet()); if ((reducedMap.Count == 0) || (reducedMap.Count == 1 && reducedMap[0].Count == 0)) { return(null); } return(reducedMap); }
public virtual void testReduceMap() { JDFAttributeMap m1 = new JDFAttributeMap("a1", "v1"); VJDFAttributeMap v2 = new VJDFAttributeMap(); v2.Add(new JDFAttributeMap(m1)); m1.put("a2", "v2"); JDFAttributeMap m2 = new JDFAttributeMap(m1); m2.put("a2", "v3"); VJDFAttributeMap v = new VJDFAttributeMap(); v.Add(m1); v.Add(m2); VString vs = new VString("a1", " "); v.reduceMap(vs.getSet()); Assert.AreEqual(v2, v); }
public virtual JDFPRItem setPR(JDFAction action, int pageSet, JDFAttributeMap prMap, VString groupBy) { JDFAttributeMap groupMap = null; JDFAttributeMap instanceMap = null; if (prMap != null) { groupMap = new JDFAttributeMap(prMap); SupportClass.SetSupport <string> @set = groupBy.getSet(); groupMap.reduceMap(@set); instanceMap = new JDFAttributeMap(prMap); instanceMap.removeKeys(@set); } JDFPRItem pi = getCreatePRItem(action, groupMap); JDFPRGroup pg = pi.getCreatePRGroup(groupMap); JDFPROccurrence pgInstance = pg.getCreatePROccurrence(instanceMap); pgInstance.addOccurrences(1, action.getSeverity()); pi.insertPageSet(pageSet); return(pi); }
/// /// * <param name="icsLevel"> /// * @return </param> /// protected internal override JDFNodeInfo initNodeInfo() { JDFNodeInfo ni = base.initNodeInfo(); if (vParts != null) { VJDFAttributeMap reducedMap = new VJDFAttributeMap(vParts); VString reduceKeys = new VString(partIDKeys); // simplex and perfecting are one run only if (EnumWorkStyle.Simplex.Equals(workStyle) || EnumWorkStyle.Perfecting.Equals(workStyle)) { reduceKeys.Remove(AttributeName.SIDE); } reducedMap.reduceMap(reduceKeys.getSet()); theNode.setPartStatus(reducedMap, EnumNodeStatus.Waiting, null); for (int i = 0; i < reducedMap.Count; i++) { JDFAttributeMap part = reducedMap[i]; JDFNodeInfo niPart = (JDFNodeInfo)ni.getCreatePartition(part, partIDKeys); niPart.setDescriptiveName("Printing for" + part.ToString()); } } return(ni); }