Files
.circleci
.github
.mvn
abstract-document
abstract-factory
active-object
acyclic-visitor
adapter
aggregator-microservices
ambassador
api-gateway
arrange-act-assert
async-method-invocation
balking
bridge
builder
business-delegate
bytecode
etc
bytecode.urm.png
bytecode.urm.puml
src
README.md
pom.xml
caching
callback
chain-of-responsibility
circuit-breaker
cloud-static-content-hosting
collection-pipeline
combinator
command
commander
composite
composite-entity
converter
cqrs
dao
data-bus
data-locality
data-mapper
data-transfer-object
decorator
delegation
dependency-injection
dirty-flag
domain-model
double-buffer
double-checked-locking
double-dispatch
eip-aggregator
eip-message-channel
eip-publish-subscribe
eip-splitter
eip-wire-tap
etc
event-aggregator
event-asynchronous
event-driven-architecture
event-queue
event-sourcing
execute-around
extension-objects
facade
factory
factory-kit
factory-method
fanout-fanin
feature-toggle
filterer
fluentinterface
flux
flyweight
front-controller
game-loop
guarded-suspension
half-sync-half-async
hexagonal
intercepting-filter
interpreter
iterator
layers
lazy-loading
leader-election
leader-followers
localization
lockable-object
marker
master-worker-pattern
mediator
memento
model-view-controller
model-view-presenter
model-view-viewmodel
module
monad
monostate
multiton
mute-idiom
naked-objects
null-object
object-mother
object-pool
observer
page-object
parameter-object
partial-response
pipeline
poison-pill
presentation
priority-queue
private-class-data
producer-consumer
promise
property
prototype
proxy
queue-load-leveling
reactor
reader-writer-lock
registry
repository
resource-acquisition-is-initialization
retry
role-object
saga
separated-interface
servant
serverless
service-layer
service-locator
sharding
singleton
spatial-partition
special-case
specification
state
step-builder
strangler
strategy
subclass-sandbox
table-module
template-method
thread-pool
throttling
tls
tolerant-reader
trampoline
transaction-script
twin
typeobjectpattern
unit-of-work
update-method
value-object
version-number
visitor
.all-contributorsrc
.gitignore
CONTRIBUTING.MD
LICENSE.md
PULL_REQUEST_TEMPLATE.md
README.md
checkstyle-suppressions.xml
gpl-3.0.txt
lgpl-3.0.txt
license-plugin-header-style.xml
lombok.config
mvnw
mvnw.cmd
pom.xml
java-design-patterns/bytecode/etc/bytecode.urm.puml

73 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2019-12-07 18:03:49 +02:00
@startuml
package com.iluwatar.bytecode {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
enum Instruction {
+ ADD {static}
+ DIVIDE {static}
+ GET_AGILITY {static}
+ GET_HEALTH {static}
+ GET_WISDOM {static}
+ LITERAL {static}
+ PLAY_SOUND {static}
+ SET_AGILITY {static}
+ SET_HEALTH {static}
+ SET_WISDOM {static}
+ SPAWN_PARTICLES {static}
- intValue : int
2019-12-07 18:03:49 +02:00
+ getInstruction(value : int) : Instruction {static}
+ getIntValue() : int
+ valueOf(name : String) : Instruction {static}
+ values() : Instruction[] {static}
}
class VirtualMachine {
- LOGGER : Logger {static}
2019-12-07 18:03:49 +02:00
- stack : Stack<Integer>
- wizards : Wizard[]
+ VirtualMachine()
+ VirtualMachine(wizard1 : Wizard, wizard2 : Wizard)
2019-12-07 18:03:49 +02:00
+ execute(bytecode : int[])
+ getAgility(wizard : int) : int
+ getHealth(wizard : int) : int
+ getStack() : Stack<Integer>
+ getWisdom(wizard : int) : int
+ getWizards() : Wizard[]
- randomInt(min : int, max : int) : int
2019-12-07 18:03:49 +02:00
+ setAgility(wizard : int, amount : int)
+ setHealth(wizard : int, amount : int)
+ setWisdom(wizard : int, amount : int)
}
class Wizard {
- LOGGER : Logger {static}
- agility : int
- health : int
- numberOfPlayedSounds : int
- numberOfSpawnedParticles : int
- wisdom : int
+ Wizard(health : int, agility : int, wisdom : int, numberOfPlayedSounds : int, numberOfSpawnedParticles : int)
2019-12-07 18:03:49 +02:00
+ getAgility() : int
+ getHealth() : int
+ getNumberOfPlayedSounds() : int
+ getNumberOfSpawnedParticles() : int
+ getWisdom() : int
+ playSound()
+ setAgility(agility : int)
+ setHealth(health : int)
+ setNumberOfPlayedSounds(numberOfPlayedSounds : int)
+ setNumberOfSpawnedParticles(numberOfSpawnedParticles : int)
2019-12-07 18:03:49 +02:00
+ setWisdom(wisdom : int)
+ spawnParticles()
}
}
package com.iluwatar.bytecode.util {
class InstructionConverterUtil {
+ InstructionConverterUtil()
+ convertToByteCode(instructions : String) : int[] {static}
- isValidInstruction(instruction : String) : boolean {static}
- isValidInt(value : String) : boolean {static}
}
}
@enduml