-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathNodes.bas
68 lines (40 loc) · 1.17 KB
/
Nodes.bas
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Option Explicit
Private pIndex As Long
Private pLeft As Nodes ' the maximal length of array object
Private pRight As Nodes ' the length of current List Object
Private pVal As Variant ' the type of the class
Public Function toString() As String
toString = "<Nodes #" & pIndex & " " & pVal & ">"
End Function
Public Property Get value() As Variant
If IsObject(pVal) Then
Set value = pVal
Else
value = pVal
End If
End Property
Public Property Let leftNode(ByRef n As Nodes)
Set pLeft = n
End Property
Public Property Let index(ByVal i As Long)
pIndex = i
End Property
Public Property Let RightNode(ByRef n As Nodes)
Set pRight = n
End Property
Public Property Get index() As Long
index = pIndex
End Property
Public Property Get leftNode() As Nodes
Set leftNode = pLeft
End Property
Public Property Get RightNode() As Nodes
Set RightNode = pRight
End Property
Public Function init(ByRef l As Nodes, ByRef r As Nodes, ByVal i As Long, ByVal val As Variant) As Nodes
Set pLeft = l
Set pRight = r
pIndex = i
pVal = val
Set init = Me
End Function