/// <summary>
        /// Internal method. Returns true if this rule matches the given index value.
        /// The index value is an 8-bit integer, 0..255, representing the low byte of
        /// the first character of the key. It matches this rule if it matches the
        /// first character of the key, or if the first character of the key is a
        /// set, and the set contains any character with a low byte equal to the
        /// index value. If the rule contains only ante context, as in foo)>bar, then
        /// it will match any key.
        /// </summary>
        ///
        internal bool MatchesIndexValue(int v)
        {
            // Delegate to the key, or if there is none, to the postContext.
            // If there is neither then we match any key; return true.
            UnicodeMatcher m = (key != null) ? key : postContext;

            return((m != null) ? m.MatchesIndexValue(v) : true);
        }
Esempio n. 2
0
        /// <summary>
        /// Implement UnicodeMatcher
        /// </summary>
        ///
        public virtual bool MatchesIndexValue(int v)
        {
            if (pattern.Length == 0)
            {
                return(true);
            }
            int            c = IBM.ICU.Text.UTF16.CharAt(pattern, 0);
            UnicodeMatcher m = data.LookupMatcher(c);

            return((m == null) ? ((c & 0xFF) == v) : m.MatchesIndexValue(v));
        }
Esempio n. 3
0
 /// <summary>
 /// Implement UnicodeMatcher API
 /// </summary>
 ///
 public virtual bool MatchesIndexValue(int v)
 {
     return((minCount == 0) || matcher.MatchesIndexValue(v));
 }