jmce - 1_02

jmce.sim.memory
Class CombinedMemory

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.memory.AbstractMemory
              extended by jmce.sim.memory.CombinedMemory
All Implemented Interfaces:
Hardware, Memory, Peripheral
Direct Known Subclasses:
Memory128K, Memory48K

public class CombinedMemory
extends AbstractMemory
implements Memory

Memory made from other memory.

This type of memory is the result of addtion of other memory for example if we add one memory of 4 KB and another of 20 KB the total size of the memory will be 24 KB.

Limitations

Version:
1.01
Author:
Mario Viara
See Also:
AbstractMemory.addMemory(jmce.sim.Memory)

Field Summary
 
Fields inherited from class jmce.sim.memory.AbstractMemory
size, vms
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Constructor Summary
CombinedMemory()
           
CombinedMemory(java.lang.String name)
           
 
Method Summary
protected  int get(int a)
          Get memory.
 int getSize()
          Return the size of the memory in byte.
 void init(Hardware parent)
          Initialize the hardware.
protected  int mapAddress(int a)
          Map address for virtual memory.
protected  Memory mapMemory(int a)
          Map memory for virtual memory.
protected  void set(int a, int v)
          Set memory.
 void setSize(int newSize)
          Set the size of the memory.
 java.lang.String toString()
           
 
Methods inherited from class jmce.sim.memory.AbstractMemory
addHardwareMemory, addMemory, addMemoryReadListener, addMemoryReadListener, addMemoryWriteListener, addMemoryWriteListener, clrBit, getMemory, getMemoryAt, getMemoryCount, getMemoryName, getMemoryReadListenerAt, getMemoryReadListenerAt, getMemoryReadListenerCount, getMemoryReadListenerCount, getMemoryWriteListenerAt, getMemoryWriteListenerAt, getMemoryWriteListenerCount, getMemoryWriteListenerCount, getReadOnly, isBit, removeMemoryReadListener, removeMemoryReadListener, removeMemoryWriteListener, removeMemoryWriteListener, setBit, setMemory, setMemoryName, setReadOnly, setReadOnly, setReadOnly
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, registerCPU, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Memory
addMemoryReadListener, addMemoryReadListener, addMemoryWriteListener, addMemoryWriteListener, clrBit, getMemory, getMemoryName, getMemoryReadListenerAt, getMemoryReadListenerAt, getMemoryReadListenerCount, getMemoryReadListenerCount, getMemoryWriteListenerAt, getMemoryWriteListenerAt, getMemoryWriteListenerCount, getMemoryWriteListenerCount, getReadOnly, isBit, removeMemoryReadListener, removeMemoryReadListener, removeMemoryWriteListener, removeMemoryWriteListener, setBit, setMemory, setMemoryName, setReadOnly, setReadOnly, setReadOnly
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Constructor Detail

CombinedMemory

public CombinedMemory()

CombinedMemory

public CombinedMemory(java.lang.String name)
Method Detail

set

protected void set(int a,
                   int v)
Description copied from class: AbstractMemory
Set memory.

Used by subclass to implement the phisical memory.

Specified by:
set in class AbstractMemory

get

protected int get(int a)
Description copied from class: AbstractMemory
Get memory.

Used by subclass to implement the phisical memory.

Specified by:
get in class AbstractMemory

setSize

public void setSize(int newSize)
Description copied from interface: Memory
Set the size of the memory.

Specified by:
setSize in interface Memory
Overrides:
setSize in class AbstractMemory

getSize

public int getSize()
Description copied from interface: Memory
Return the size of the memory in byte.

Specified by:
getSize in interface Memory
Overrides:
getSize in class AbstractMemory

mapMemory

protected final Memory mapMemory(int a)
Description copied from class: AbstractMemory
Map memory for virtual memory.

This method must be overriden from virtual memory sub class.

Overrides:
mapMemory in class AbstractMemory

mapAddress

protected final int mapAddress(int a)
Description copied from class: AbstractMemory
Map address for virtual memory.

This method must be overridden from virtual memory sub class.

Overrides:
mapAddress in class AbstractMemory

init

public void init(Hardware parent)
          throws SIMException
Description copied from interface: Hardware
Initialize the hardware. This method must be called before any use of the interface. Only set ... / get ... method are allowed to be called before the intialization.

Specified by:
init in interface Hardware
Overrides:
init in class AbstractHardware
Parameters:
parent - Parent of this hardware.
Throws:
SIMException

toString

public java.lang.String toString()
Overrides:
toString in class AbstractMemory

jmce - 1_02