/** * The Sys class provides a centralized point of access to all the system components. * It should be instantiated by the first class to use the new system, and sets up both * the CPU and the memory. It should be passed to any other components that need * access to the Processor, Memory, or Video components of the system. Also, please * remember to the the video component by calling setVideo(). */ public class Sys { /** * The version of the SaM Core */ public static final String SAM_VERSION = "2.2.4"; /** * Returns the CPU */ public Processor cpu() { return CPU; } /** * Returns the Memory */ public Memory mem() { return MEM; } /** * Returns the Video */ public Video video() { return VIDEO; } /** * Sets the video to the provided component */ public void setVideo(Video v) { VIDEO = v; } /** * Creates a new Sys with a default Processor and memory */ public Sys() { CPU = new SamProcessor(this); MEM = new SamMemory(this); } protected Processor CPU; protected Memory MEM; protected Video VIDEO; }