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

            StringCodePointIterator that = (StringCodePointIterator)obj;

            if (GetHashCode() != that.GetHashCode())
            {
                return(false);
            }
            if (!text.Equals(that.text))
            {
                return(false);
            }
            if (pos != that.pos || end != that.end)
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
 /// <summary>
 /// Creates a copy of this iterator. </summary>
 /// <returns> A copy of this </returns>
 public object clone()
 {
     try
     {
         StringCodePointIterator other = (StringCodePointIterator)base.MemberwiseClone();
         return(other);
     }
     catch
     {
         throw new Exception();
     }
 }