forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnull-object.urm.puml
More file actions
41 lines (41 loc) · 916 Bytes
/
Copy pathnull-object.urm.puml
File metadata and controls
41 lines (41 loc) · 916 Bytes
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
@startuml
package com.iluwatar.nullobject {
class App {
+ App()
+ main(args : String[]) {static}
}
interface Node {
+ getLeft() : Node {abstract}
+ getName() : String {abstract}
+ getRight() : Node {abstract}
+ getTreeSize() : int {abstract}
+ walk() {abstract}
}
class NodeImpl {
- LOGGER : Logger {static}
- left : Node
- name : String
- right : Node
+ NodeImpl(name : String, left : Node, right : Node)
+ getLeft() : Node
+ getName() : String
+ getRight() : Node
+ getTreeSize() : int
+ walk()
}
class NullNode {
- instance : NullNode {static}
- NullNode()
+ getInstance() : NullNode {static}
+ getLeft() : Node
+ getName() : String
+ getRight() : Node
+ getTreeSize() : int
+ walk()
}
}
NullNode --> "-instance" NullNode
NodeImpl --> "-left" Node
NodeImpl ..|> Node
NullNode ..|> Node
@enduml