コード例 #1
0
ファイル: JDFAttributeMap.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> * overlapMap - identical keys must have the same values in both maps i.e submap is either a superset or a subset of
        ///	 * this
        ///	 *  </summary>
        ///	 * <param name="subMap"> the map to compare with <code>this</this>
        ///	 *  </param>
        ///	 * <returns> boolean - true if identical keys have the same values in both maps </returns>
        ///
        public virtual bool overlapMap(JDFAttributeMap subMap)
        {
            if (subMap == null || subMap.Count == 0)
            {
                return(true);
            }

            IEnumerator <string> subMapEnum = subMap.getKeyIterator();

            while (subMapEnum.MoveNext())
            {
                string subMapKey = subMapEnum.Current;
                string subMapVal = subMap[subMapKey];
                if (KElement.isWildCard(subMapVal))
                {
                    continue;
                }

                string val = this[subMapKey];
                if (val != null && !subMapVal.Equals(val))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
ファイル: JDFAttributeMap.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> * entrySet - Returns a Set view of the entries contained in this Hashtable. Each element in this collection is a
        ///	 * Map.Entry. The Set is backed by the Hashtable, so changes to the Hashtable are reflected in the Set, and
        ///	 * vice-versa. The Set supports element removal (which removes the corresponding entry from the Hashtable), but not
        ///	 * element addition.
        ///	 *  </summary>
        ///	 * <returns> Set - the set view of the entries contained in this hashtable </returns>
        ///
        // TODO: Just Delete this?
        //      public virtual Set entrySet()
        //      {
        ////JAVA TO VB & C# CONVERTER TODO TASK: There is no .NET Dictionary equivalent to the Java 'entrySet' method:
        //         return m_hashTable.entrySet();
        //      }

        ///
        ///	 <summary> * subMap - returns true if map contains subMap, all keys of submap must be in this hashtable and they must have the
        ///	 * same value<br>
        ///	 *
        ///	 * if subMap is null, the function returns true if subMap contains any wildcards, then the existance of the key in
        ///	 * this defines a match
        ///	 *  </summary>
        ///	 * <param name="subMap"> the map to compare
        ///	 *  </param>
        ///	 * <returns> boolean - true if this map contains subMap </returns>
        ///
        public virtual bool subMap(JDFAttributeMap subMap)
        {
            if (subMap == null) // the null map is a subset of everything
            {
                return(true);
            }

            ICollection <string> mapSet    = this.Keys;
            ICollection <string> subMapSet = subMap.Keys;

            if (!this.containsAll(subMapSet))
            {
                return(false);
            }

            IEnumerator <string> it = subMapSet.GetEnumerator();

            while (it.MoveNext())
            {
                string key    = it.Current;
                string subVal = subMap[key];
                if (!KElement.isWildCard(subVal))
                {
                    string val = this[key];
                    if (!val.Equals(subVal))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
コード例 #3
0
 //       (non-Javadoc)
 //		 * @see org.cip4.jdflib.jmf.JDFQueue.ExecuteCallback#canExecute(org.cip4.jdflib.jmf.JDFQueueEntry)
 //
 public override bool canExecute(JDFQueueEntry qe)
 {
     if (proxy != null && qe.hasAttribute(proxy))
     {
         return(false);
     }
     if (deviceID != null && !KElement.isWildCard(qe.getDeviceID()) && !deviceID.Equals(qe.getDeviceID()))
     {
         return(false);
     }
     return(true);
 }
コード例 #4
0
        ///
        ///     <summary> * overwrite this method in case you want to customize the hotfolder for returnqueueentryparams and paramtetrizing
        ///     * the ReturnQueueEntryParams template is insufficient
        ///     * </summary>
        ///     * <param name="stringURL"> the file url of the hotfolder jdf in the local storage directory (NOT the hf) </param>
        ///     * <param name="newCommand"> the command that was generated from the template </param>
        ///     * <param name="jdfRoot"> the root jdfnode of the dropped file </param>
        ///
        protected internal virtual void extractReturnParams(string stringURL, JDFCommand newCommand, JDFNode jdfRoot)
        {
            JDFReturnQueueEntryParams rqp = newCommand.getCreateReturnQueueEntryParams(0);

            rqp.setURL(stringURL);
            JDFAuditPool ap = jdfRoot == null ? null : jdfRoot.getCreateAuditPool();

            if (ap != null)
            {
                JDFProcessRun pr       = (JDFProcessRun)ap.getAudit(-1, EnumAuditType.ProcessRun, null, null);
                string        queueEID = pr == null ? null : pr.getAttribute(AttributeName.QUEUEENTRYID);
                if (!KElement.isWildCard(queueEID))
                {
                    rqp.setQueueEntryID(queueEID);
                }
            }
        }
コード例 #5
0
ファイル: JDFIntentResource.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> * set actual values to the preset defined in preferred
        ///	 *  </summary>
        ///	 * <param name="String">
        ///	 *            key the key of the span resource to modify, if null do all </param>
        ///	 * <returns> number of elements modified </returns>
        ///
        public virtual int preferredToActual(string key)
        {
            int nDone = 0;

            if (!isLeaf())
            {
                VElement leaves = getLeaves(false);
                for (int i = 0; i < leaves.Count; i++)
                {
                    JDFIntentResource ri = (JDFIntentResource)leaves[i];
                    nDone += ri.preferredToActual(key);
                }
                return(nDone);
            }
            VString vKeys = new VString();

            if (KElement.isWildCard(key))
            {
                VElement v = getChildrenByTagName(null, null, new JDFAttributeMap(AttributeName.DATATYPE, (string)null), true, true, 0);
                for (int i = 0; i < v.Count; i++)
                {
                    vKeys.Add(v[i].Name);
                }
            }
            else
            {
                vKeys.Add(key);
            }
            for (int i = 0; i < vKeys.Count; i++)
            {
                JDFSpanBase @base = (JDFSpanBase)getElement(vKeys[i], JDFConstants.EMPTYSTRING, 0);
                if (@base.preferredToActual())
                {
                    nDone++;
                }
            }
            return(nDone);
        }
コード例 #6
0
ファイル: JDFAuditPool.cs プロジェクト: cip4/JDFLibNet
        ///
        ///	 <summary> * getLastPhase - get the most recent PhaseTime audit in this pool
        ///	 *  </summary>
        ///	 * <param name="vPartMap"> the list of matching partMaps </param>
        ///	 * <returns> JDFAudit - the last PhaseTime audit </returns>
        ///
        public virtual JDFPhaseTime getLastPhase(VJDFAttributeMap vPartMap, string moduleID)
        {
            if (KElement.isWildCard(moduleID))
            {
                return((JDFPhaseTime)getAudit(-1, EnumAuditType.PhaseTime, null, vPartMap));
            }

            VElement e = getAudits(EnumAuditType.PhaseTime, null, vPartMap);

            if (e != null)
            {
                int size = e.Count - 1;
                for (int i = size; i >= 0; i--)
                {
                    JDFPhaseTime pt = (JDFPhaseTime)e[i];
                    if (pt.getChildWithAttribute(ElementName.MODULEPHASE, AttributeName.MODULEID, null, moduleID, 0, true) != null)
                    {
                        return(pt);
                    }
                }
            }

            return(null);
        }