-
Notifications
You must be signed in to change notification settings - Fork 1
/
DequeNodes.cs
51 lines (41 loc) · 1.05 KB
/
DequeNodes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
namespace Immutable_Deque_visualization
{
public abstract class DequeNodeBase
{}
public class ValueNode<T> : DequeNodeBase
{
public T Value { get; protected set; }
public ValueNode(T value)
{
Value = value;
}
public override string ToString()
{
return Value.ToString();
}
}
public class DequeNode<T> : DequeNodeBase
{
public IDeque<T> Deque { get; protected set; }
public DequeNode(IDeque<T> deque)
{
Deque = deque;
}
public override string ToString()
{
return Deque.GetType().GetShortName();
}
}
public class DequeletteNode<T> : DequeNodeBase
{
public Deque<T>.Dequelette Dequelette { get; protected set; }
public DequeletteNode(Deque<T>.Dequelette dequelette)
{
Dequelette = dequelette;
}
public override string ToString()
{
return Dequelette.GetType().GetShortName();
}
}
}