/*
Copyright 2007-2013 The NGenerics Team
(https://github.com/ngenerics/ngenerics/wiki/Team)
This program is licensed under the GNU Lesser General Public License (LGPL). You should
have received a copy of the license along with the source code. If not, an online copy
of the license can be found at http://www.gnu.org/copyleft/lesser.html.
*/
using System;using System.Diagnostics.CodeAnalysis;
namespace NGenerics.DataStructures.Trees {
///
/// A container class, used for the RedBlackTree.
///
/// The type of element.
//[Serializable]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
internal class RedBlackTreeNode : BinaryTree {
#region Construction
///
/// Initializes a new instance of the class.
///
/// The data contained in this node.
internal RedBlackTreeNode(T data)
: base(data) {
Color = NodeColor.Red;
}
#endregion
#region Properties
///
/// Gets or sets the color of the current node.
///
/// The color of the node.
internal NodeColor Color { get; set; }
///
/// Gets or sets the with the specified direction.
///
///
internal RedBlackTreeNode this[bool direction] {
get {
return direction ? Right : Left;
}
set {
if (direction) {
Right = value;
} else {
Left = value;
}
}
}
///
/// Gets or sets the left subtree.
///
/// The left subtree.
internal new RedBlackTreeNode Left {
get {
return (RedBlackTreeNode)base.Left;
}
set {
base.Left = value;
}
}
///
/// Gets or sets the right subtree.
///
/// The right subtree.
internal new RedBlackTreeNode Right {
get {
return (RedBlackTreeNode)base.Right;
}
set {
base.Right = value;
}
}
#endregion
}
}