AIMA.Core.Logic.FOL.KB.Data.Literal.Equals C# (CSharp) Method

Equals() public method

public Equals ( Object o ) : bool
o Object
return bool
        public override bool Equals(Object o)
        {

            if (this == o)
            {
                return true;
            }
            if (o.GetType() != this.GetType())
            {
                // This prevents ReducedLiterals
                // being treated as equivalent to
                // normal Literals.
                return false;
            }
            if (!(o is Literal))
            {
                return false;
            }
            Literal l = (Literal)o;
            return l.isPositiveLiteral() == isPositiveLiteral()
                    && l.getAtomicSentence().getSymbolicName().Equals(
                            atom.getSymbolicName())
                    && l.getAtomicSentence().getArgs().Equals(atom.getArgs());
        }