Пример #1
0
        ///
        ///	 <summary> * gets a vector of all terms
        ///	 *  </summary>
        ///	 * <returns> VElement - vector of JDFTerm </returns>
        ///
        public virtual VElement getTermVector(EnumTerm term)
        {
            if (term != null)
            {
                return(getChildElementVector(term.getName(), null, null, true, 0, false));
            }

            VElement v = new VElement();
            KElement e = getFirstChildElement();

            while (e != null)
            {
                if (e is JDFTerm)
                {
                    v.Add(e);
                }
                e = e.getNextSiblingElement();
            }
            return(v); // if no subelements, then no context
        }
Пример #2
0
        ///
        ///	 <summary> * get the iSkip'th Term of type term, do not create it if it does not exist
        ///	 *  </summary>
        ///	 * <param name="term">
        ///	 *            type of term to append </param>
        ///	 * <param name="iSkip">
        ///	 *            number of terms to skip, 0 is the first </param>
        ///	 * <returns> JDFTerm - the requested term, <code>null</code> if none exists </returns>
        ///
        public virtual JDFTerm getTerm(EnumTerm term, int iSkip)
        {
            if (term != null)
            {
                return((JDFTerm)getElement(term.getName(), null, iSkip));
            }
            XmlNode e = FirstChild;
            int     n = 0;

            while (e != null)
            {
                if (e is JDFTerm)
                {
                    if (++n > iSkip)
                    {
                        return((JDFTerm)e);
                    }
                }
                e = e.NextSibling;
            }
            return(null);
        }
Пример #3
0
 ///
 ///	 <summary> * append a Term as defined by <code>term</code>
 ///	 *  </summary>
 ///	 * <param name="term">
 ///	 *            type of term to append </param>
 ///	 * <returns> JDFTerm the appended term </returns>
 ///
 public virtual JDFTerm appendTerm(EnumTerm term)
 {
     return((JDFTerm)appendElement(term.getName(), null));
 }
Пример #4
0
 ///
 ///	 <summary> * get the iSkip'th Term of type <code>term</code>, create it if it does not
 ///	 * exist
 ///	 *  </summary>
 ///	 * <param name="term">
 ///	 *            type of term to append </param>
 ///	 * <param name="iSkip">
 ///	 *            number of terms to skip, 0 is the first </param>
 ///	 * <returns> JDFTerm - the requested term </returns>
 ///
 public virtual JDFTerm getCreateTerm(EnumTerm term, int iSkip)
 {
     return((JDFTerm)getCreateElement(term.getName(), null, iSkip));
 }