Exemplo n.º 1
0
 /// <summary>
 /// Set the BreakIterator that is used to restrict the points at which
 /// matches are detected. Using <tt>null</tt> as the parameter is legal; it
 /// means that break detection should not be attempted. See class
 /// documentation for more information.
 /// </summary>
 ///
 /// <param name="breakiter">A BreakIterator that will be used to restrict the points atwhich matches are detected.</param>
 /// <seealso cref="M:IBM.ICU.Text.SearchIterator.GetBreakIterator"/>
 /// <seealso cref="T:IBM.ICU.Text.BreakIterator"/>
 /// @stable ICU 2.0
 public void SetBreakIterator(BreakIterator breakiter)
 {
     breakIterator = breakiter;
     if (breakIterator != null)
     {
         breakIterator.SetText(targetText);
     }
 }
Exemplo n.º 2
0
        // protected constructor ----------------------------------------------

        /// <summary>
        /// Protected constructor for use by subclasses. Initializes the iterator
        /// with the argument target text for searching and sets the BreakIterator.
        /// See class documentation for more details on the use of the target text
        /// and BreakIterator.
        /// </summary>
        ///
        /// <param name="target">The target text to be searched.</param>
        /// <param name="breaker">A <see cref="T:IBM.ICU.Text.BreakIterator"/> that is used to determine theboundaries of a logical match. This argument can be null.</param>
        /// <exception cref="IllegalArgumentException">thrown when argument target is null, or of length 0</exception>
        /// <seealso cref="T:IBM.ICU.Text.BreakIterator"/>
        /// @stable ICU 2.0
        protected internal SearchIterator(ICharacterIterator target, BreakIterator breaker)
        {
            if (target == null ||
                (target.GetEndIndex() - target.GetBeginIndex()) == 0)
            {
                throw new ArgumentException("Illegal argument target. "
                                            + " Argument can not be null or of length 0");
            }
            targetText    = target;
            breakIterator = breaker;
            if (breakIterator != null)
            {
                breakIterator.SetText(target);
            }
            matchLength           = 0;
            m_lastMatchStart_     = DONE;
            m_isOverlap_          = false;
            m_isForwardSearching_ = true;
            m_reset_     = true;
            m_setOffset_ = DONE;
        }
Exemplo n.º 3
0
 public override Object RegisterInstance(BreakIterator iter, ULocale locale, int kind)
 {
     iter.SetText(new ILOG.J2CsMapping.Text.StringCharacterIterator(""));
     return(service.RegisterObject(iter, locale, kind));
 }