Ejemplo n.º 1
0
        /// <summary>
        /// Implementation of Equals for Blank Nodes.
        /// </summary>
        /// <param name="other">Object to compare with the Blank Node.</param>
        /// <returns></returns>
        /// <remarks>
        /// Blank Nodes are considered equal if their internal IDs match precisely and they originate from the same Graph.
        /// </remarks>
        public override bool Equals(INode other)
        {
            if ((Object)other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (other.NodeType == NodeType.Blank)
            {
                IBlankNode temp = (IBlankNode)other;

                return(EqualityHelper.AreBlankNodesEqual(this, temp));
            }
            else
            {
                // Can only be equal to Blank Nodes
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Determines whether this Node is equal to another.
 /// </summary>
 /// <param name="other">Other Blank Node.</param>
 /// <returns></returns>
 public override bool Equals(IBlankNode other)
 {
     return(EqualityHelper.AreBlankNodesEqual(this, other));
 }