edu.cornell.cs.sam.core
Class Sys

java.lang.Object
  extended by edu.cornell.cs.sam.core.Sys

public class Sys
extends java.lang.Object

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().


Field Summary
static java.lang.String SAM_VERSION
          The version of the SaM Core
 
Constructor Summary
Sys()
          Creates a new single cpu Sys.
Sys(int n)
          Creates a new Sys with processor(s) and memory
 
Method Summary
 Processor cpu()
          Returns the first CPU (or null if no CPUs)
 java.util.Collection<Processor> cpus()
          Returns the CPU collection (or null if no CPUs are available)
 Memory mem()
          Returns the shared memory (or null if no memory)
 void setVideo(Video v)
          Sets the video card to the provided component
 Video video()
          Returns the video card (or null if no video card)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAM_VERSION

public static final java.lang.String SAM_VERSION
The version of the SaM Core

See Also:
Constant Field Values
Constructor Detail

Sys

public Sys()
Creates a new single cpu Sys.


Sys

public Sys(int n)
Creates a new Sys with processor(s) and memory

Parameters:
n - - The number of processors to launch
Method Detail

cpu

public Processor cpu()
Returns the first CPU (or null if no CPUs)


cpus

public java.util.Collection<Processor> cpus()
Returns the CPU collection (or null if no CPUs are available)


mem

public Memory mem()
Returns the shared memory (or null if no memory)


video

public Video video()
Returns the video card (or null if no video card)


setVideo

public void setVideo(Video v)
Sets the video card to the provided component