107 lines
2.4 KiB
Plaintext
107 lines
2.4 KiB
Plaintext
@startuml
|
|
package com.iluwatar.specification.creature {
|
|
abstract class AbstractCreature {
|
|
- color : Color
|
|
- movement : Movement
|
|
- name : String
|
|
- size : Size
|
|
+ AbstractCreature(name : String, size : Size, movement : Movement, color : Color)
|
|
+ getColor() : Color
|
|
+ getMovement() : Movement
|
|
+ getName() : String
|
|
+ getSize() : Size
|
|
+ toString() : String
|
|
}
|
|
interface Creature {
|
|
+ getColor() : Color {abstract}
|
|
+ getMovement() : Movement {abstract}
|
|
+ getName() : String {abstract}
|
|
+ getSize() : Size {abstract}
|
|
}
|
|
class Dragon {
|
|
+ Dragon()
|
|
}
|
|
class Goblin {
|
|
+ Goblin()
|
|
}
|
|
class KillerBee {
|
|
+ KillerBee()
|
|
}
|
|
class Octopus {
|
|
+ Octopus()
|
|
}
|
|
class Shark {
|
|
+ Shark()
|
|
}
|
|
class Troll {
|
|
+ Troll()
|
|
}
|
|
}
|
|
package com.iluwatar.specification.property {
|
|
enum Color {
|
|
+ DARK {static}
|
|
+ GREEN {static}
|
|
+ LIGHT {static}
|
|
+ RED {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Color {static}
|
|
+ values() : Color[] {static}
|
|
}
|
|
enum Movement {
|
|
+ FLYING {static}
|
|
+ SWIMMING {static}
|
|
+ WALKING {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Movement {static}
|
|
+ values() : Movement[] {static}
|
|
}
|
|
enum Size {
|
|
+ LARGE {static}
|
|
+ NORMAL {static}
|
|
+ SMALL {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Size {static}
|
|
+ values() : Size[] {static}
|
|
}
|
|
}
|
|
package com.iluwatar.specification.selector {
|
|
class ColorSelector {
|
|
- c : Color
|
|
+ ColorSelector(c : Color)
|
|
+ test(t : Creature) : boolean
|
|
}
|
|
class MovementSelector {
|
|
- m : Movement
|
|
+ MovementSelector(m : Movement)
|
|
+ test(t : Creature) : boolean
|
|
}
|
|
class SizeSelector {
|
|
- s : Size
|
|
+ SizeSelector(s : Size)
|
|
+ test(t : Creature) : boolean
|
|
}
|
|
}
|
|
package com.iluwatar.specification.app {
|
|
class App {
|
|
- LOGGER : Logger {static}
|
|
+ App()
|
|
+ main(args : String[]) {static}
|
|
}
|
|
}
|
|
SizeSelector --> "-s" Size
|
|
AbstractCreature --> "-color" Color
|
|
MovementSelector --> "-m" Movement
|
|
AbstractCreature --> "-movement" Movement
|
|
AbstractCreature --> "-size" Size
|
|
ColorSelector --> "-c" Color
|
|
AbstractCreature ..|> Creature
|
|
Dragon --|> AbstractCreature
|
|
Goblin --|> AbstractCreature
|
|
KillerBee --|> AbstractCreature
|
|
Octopus --|> AbstractCreature
|
|
Shark --|> AbstractCreature
|
|
Troll --|> AbstractCreature
|
|
@enduml |