예제 #1
0
        public bool Equals(FrozenInt32Set other) // LUCENENET TODO: This didn't exist in the original
        {
            if (other == null)
            {
                return(false);
            }

            if (hashCode != other.hashCode)
            {
                return(false);
            }
            if (other.values.Length != upto)
            {
                return(false);
            }

            for (int i = 0; i < upto; i++)
            {
                if (other.values[i] != values[i])
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        public override bool Equals(object other)
        {
            if (other == null)
            {
                return(false);
            }
            if (!(other is FrozenInt32Set))
            {
                return(false);
            }
            FrozenInt32Set other2 = (FrozenInt32Set)other;

            if (hashCode != other2.hashCode)
            {
                return(false);
            }
            if (other2.values.Length != upto)
            {
                return(false);
            }
            for (int i = 0; i < upto; i++)
            {
                if (other2.values[i] != values[i])
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #3
0
            public override bool Equals(object other)
            {
                if (other == null)
                {
                    return(false);
                }
                if (other is FrozenInt32Set)
                {
                    FrozenInt32Set other2 = (FrozenInt32Set)other;
                    if (hashCode != other2.hashCode)
                    {
                        return(false);
                    }
                    if (other2.values.Length != values.Length)
                    {
                        return(false);
                    }
                    for (int i = 0; i < values.Length; i++)
                    {
                        if (other2.values[i] != values[i])
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
                else if (other is SortedInt32Set)
                {
                    SortedInt32Set other3 = (SortedInt32Set)other;
                    if (hashCode != other3.hashCode)
                    {
                        return(false);
                    }
                    if (other3.values.Length != values.Length)
                    {
                        return(false);
                    }
                    for (int i = 0; i < values.Length; i++)
                    {
                        if (other3.values[i] != values[i])
                        {
                            return(false);
                        }
                    }
                    return(true);
                }

                return(false);
            }