예제 #1
0
            /// <summary>
            /// Compares the equality of two ReplaceableCharacterIterator objects.
            /// </summary>
            ///
            /// <param name="obj">the ReplaceableCharacterIterator object to be comparedwith.</param>
            /// <returns>true if the given obj is the same as this
            /// ReplaceableCharacterIterator object; false otherwise.</returns>
            public override bool Equals(Object obj)
            {
                if ((Object)this == obj)
                {
                    return(true);
                }
                if (!(obj  is  BreakTransliterator.ReplaceableCharacterIterator))
                {
                    return(false);
                }

                BreakTransliterator.ReplaceableCharacterIterator that = (BreakTransliterator.ReplaceableCharacterIterator)obj;

                if (GetHashCode() != that.GetHashCode())
                {
                    return(false);
                }
                if (!text.Equals(that.text))
                {
                    return(false);
                }
                if (pos != that.pos || begin != that.begin || end != that.end)
                {
                    return(false);
                }
                return(true);
            }
예제 #2
0
 /// <summary>
 /// Creates a copy of this iterator.
 /// </summary>
 ///
 /// <returns>A copy of this</returns>
 public Object Clone()
 {
     try {
         BreakTransliterator.ReplaceableCharacterIterator other = (BreakTransliterator.ReplaceableCharacterIterator)base.MemberwiseClone();
         return(other);
     } catch (Exception e) {
         throw new InvalidOperationException();
     }
 }