Exemple #1
0
 /**
 * Splits a SOM name in the individual parts.
 * @param name the full SOM name
 * @return the split name
 */
 public static Stack2<String> SplitParts(String name) {
     while (name.StartsWith("."))
         name = name.Substring(1);
     Stack2<String> parts = new Stack2<String>();
     int last = 0;
     int pos = 0;
     String part;
     while (true) {
         pos = last;
         while (true) {
             pos = name.IndexOf('.', pos);
             if (pos < 0)
                 break;
             if (name[pos - 1] == '\\')
                 ++pos;
             else
                 break;
         }
         if (pos < 0)
             break;
         part = name.Substring(last, pos - last);
         if (!part.EndsWith("]"))
             part += "[0]";
         parts.Add(part);
         last = pos + 1;
     }
     part = name.Substring(last);
     if (!part.EndsWith("]"))
         part += "[0]";
     parts.Add(part);
     return parts;
 }
            /**
             * Splits a SOM name in the individual parts.
             * @param name the full SOM name
             * @return the split name
             */
            public static Stack2 SplitParts(String name)
            {
                while (name.StartsWith("."))
                {
                    name = name.Substring(1);
                }
                Stack2 parts = new Stack2();
                int    last  = 0;
                int    pos   = 0;
                String part;

                while (true)
                {
                    pos = last;
                    while (true)
                    {
                        pos = name.IndexOf('.', pos);
                        if (pos < 0)
                        {
                            break;
                        }
                        if (name[pos - 1] == '\\')
                        {
                            ++pos;
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (pos < 0)
                    {
                        break;
                    }
                    part = name.Substring(last, pos - last);
                    if (!part.EndsWith("]"))
                    {
                        part += "[0]";
                    }
                    parts.Add(part);
                    last = pos + 1;
                }
                part = name.Substring(last);
                if (!part.EndsWith("]"))
                {
                    part += "[0]";
                }
                parts.Add(part);
                return(parts);
            }
Exemple #3
0
 /**
 * Splits a SOM name in the individual parts.
 * @param name the full SOM name
 * @return the split name
 */
 public static Stack2 SplitParts(String name)
 {
     while (name.StartsWith("."))
         name = name.Substring(1);
     Stack2 parts = new Stack2();
     int last = 0;
     int pos = 0;
     String part;
     while (true) {
         pos = last;
         while (true) {
             pos = name.IndexOf('.', pos);
             if (pos < 0)
                 break;
             if (name[pos - 1] == '\\')
                 ++pos;
             else
                 break;
         }
         if (pos < 0)
             break;
         part = name.Substring(last, pos - last);
         if (!part.EndsWith("]"))
             part += "[0]";
         parts.Add(part);
         last = pos + 1;
     }
     part = name.Substring(last);
     if (!part.EndsWith("]"))
         part += "[0]";
     parts.Add(part);
     return parts;
 }