using Chernobyl.Collections.Generic.Event;
using Chernobyl.Values;
namespace Chernobyl.Collections.Generic.Graph
{
///
/// A basic implementation of an .
///
/// The type of the data contained by this.
public class DataNode : IDataNode
{
///
/// Initializes a new instance of the class that
/// holds its data in a non-modifiable .
///
/// The data held by this vertex.
public DataNode(T data)
: this(new BasicContainer(data))
{}
///
/// Initializes a new instance of the class.
///
/// The data held by this vertex.
public DataNode(IValue data)
{
Data = data;
Connections = new DecoratingEventCollection(new NodeConnections(this));
}
///
/// The data held by this vertex.
///
public IValue Data { get; private set; }
///
/// The other vertices in the network that this vertex is
/// connected to.
///
public IEventCollection Connections { get; private set; }
}
}