Exemplo n.º 1
0
        public bool Match(ParsedUri purl)
        {
            String host = purl.Host;
            // domainPrefix is a child of this, the root (with no parent)
            PrefixPhrase <O> hostPrefix = LookupChild(host);

            // children of hostPrefix
            return((hostPrefix == null) ? false : hostPrefix.Match(purl.LocalPath, separator));       //edit
        }
Exemplo n.º 2
0
        protected bool Match(String str, int start, char separator)
        {
            if (IsTerminal())
            {
                return(true);
            }

            int  end       = str.Length;
            bool terminate = false;

            if (start == end)
            {
                terminate = true;
            }
            else
            {
                if (str[start] == separator)
                {
                    start++;
                }
                if (start == end)
                {
                    terminate = true;
                }
            }
            if (terminate)
            {
                return(false);
            }

            int nextSeparator = str.IndexOf(separator, start);

            if (nextSeparator == -1)
            {
                nextSeparator = end;
            }

            //		String phraseString	= string.substring(start, nextSeparator);
            //		PrefixPhrase nextPrefixPhrase	= lookupChild(phraseString);
            PrefixPhrase <O> nextPrefixPhrase = MatchChild(str, start, nextSeparator);

            return((nextPrefixPhrase != null) && nextPrefixPhrase.Match(str, nextSeparator, separator));
        }