public final class Machine
extends java.lang.Object
Architecture
s,
which are implementations of specific languages (e.g. assembler). The built-
in ones are available as static fields in this class.
Note that registration of architectures is optional and only intended as a
convenience feature to make architectures usable via the built-in CPUs.
Note that these methods should not be called in the pre-init phase,
since the API.machine
may not have been initialized
at that time. Only start calling these methods in the init phase or later.Modifier and Type | Field and Description |
---|---|
static java.lang.Class<? extends Architecture> |
LuaArchitecture
The built-in Lua architecture.
|
Modifier and Type | Method and Description |
---|---|
static void |
add(java.lang.Class<? extends Architecture> architecture)
Register an architecture that can be used to create new machines.
|
static java.util.Collection<java.lang.Class<? extends Architecture>> |
architectures()
A list of all registered architectures.
|
static Machine |
create(MachineHost host)
Creates a new machine for the specified host.
|
static java.lang.String |
getArchitectureName(java.lang.Class<? extends Architecture> architecture)
Get the name of the specified architecture.
|
public static java.lang.Class<? extends Architecture> LuaArchitecture
public static void add(java.lang.Class<? extends Architecture> architecture)
architecture
- the architecture to register.public static java.util.Collection<java.lang.Class<? extends Architecture>> architectures()
public static java.lang.String getArchitectureName(java.lang.Class<? extends Architecture> architecture)
architecture
- the architecture to get the name for.public static Machine create(MachineHost host)
host
- the owner object of the machine, providing context.