Exemple #1
0
        /// <summary>
        /// Returns the string representation of this Package.
        /// Its value is the string "package " and the package name.
        /// If the package title is defined it is appended.
        /// If the package version is defined it is appended. </summary>
        /// <returns> the string representation of the package. </returns>
        public override String ToString()
        {
            String spec = SpecTitle;
            String ver  = SpecVersion;

            if (spec != reflect.AnnotatedElement_Fields.Null && spec.Length() > 0)
            {
                spec = ", " + spec;
            }
            else
            {
                spec = "";
            }
            if (ver != reflect.AnnotatedElement_Fields.Null && ver.Length() > 0)
            {
                ver = ", version " + ver;
            }
            else
            {
                ver = "";
            }
            return("package " + PkgName + spec + ver);
        }
        /// <summary>
        /// Implements the "More_Above" condition
        ///
        /// Specification: C is followed by one or more characters of combining
        /// class 230 (ABOVE) in the combining character sequence.
        ///
        /// Regular Expression:
        ///   After C: [{cc!=0}]*[{cc==230}]
        /// </summary>
        private static bool IsMoreAbove(String src, int index)
        {
            int ch;
            int cc;
            int len = src.Length();

            // Look for a following ABOVE combining class character
            for (int i = index + Character.CharCount(src.CodePointAt(index)); i < len; i += Character.CharCount(ch))
            {
                ch = src.CodePointAt(i);
                cc = Normalizer.getCombiningClass(ch);

                if (cc == COMBINING_CLASS_ABOVE)
                {
                    return(true);
                }
                else if (cc == 0)
                {
                    return(false);
                }
            }

            return(false);
        }
Exemple #3
0
 /// <summary>
 /// Constructs a string builder initialized to the contents of the
 /// specified string. The initial capacity of the string builder is
 /// {@code 16} plus the length of the string argument.
 /// </summary>
 /// <param name="str">   the initial contents of the buffer. </param>
 public StringBuilder(String str) : base(str.Length() + 16)
 {
     Append(str);
 }
Exemple #4
0
        private String QuoteString(String arg)
        {
            StringBuilder argbuf = new StringBuilder(arg.Length() + 2);

            return(argbuf.Append('"').Append(arg).Append('"').ToString());
        }