/
githubmirror
/
java-design-patterns
Обзор
Документация
Войти
/
githubmirror
/
java-design-patterns
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
open-source-java-design-patterns-1st-edition
bytecode/etc/bytecode.urm.puml
73 строки
2 KB
Ilkka Seppälä
docs: #590 add explanation for bytecode pattern (#1687)
22 мар 2021, 09:49
Не верифицирован
22 мар 2021, 09:49
c413e09
Код
Авторство
О чём код?
@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 + getInstruction(value : int) : Instruction {static} + getIntValue() : int + valueOf(name : String) : Instruction {static} + values() : Instruction[] {static} } class VirtualMachine { - LOGGER : Logger {static} - stack : Stack<Integer> - wizards : Wizard[] + VirtualMachine() + VirtualMachine(wizard1 : Wizard, wizard2 : Wizard) + 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 + 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) + getAgility() : int + getHealth() : int + getNumberOfPlayedSounds() : int + getNumberOfSpawnedParticles() : int + getWisdom() : int + playSound() + setAgility(agility : int) + setHealth(health : int) + setNumberOfPlayedSounds(numberOfPlayedSounds : int) + setNumberOfSpawnedParticles(numberOfSpawnedParticles : int) + 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