com.cmpware.cmp.memory
Class MemoryManager

java.lang.Object
  extended by com.cmpware.cmp.memory.MemoryManager

public class MemoryManager
extends java.lang.Object

This class manages the memories. These can be local and shared memories mapped to various addresses. This class hold these memory objects and helps map memory objects from addresses.

Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 
Constructor Summary
MemoryManager()
           
 
Method Summary
 void add(MemoryInterface m)
          This method adds a Memory to the Memory manager.
 java.lang.String dump()
          This method prints status information about the Memory system.
 MemoryInterface get(int addr)
          This method returns the memory associated with an address.
 boolean getEndian()
          This method returns the endian (byte order) of the memory system.
 MemoryInterface[] getMemories()
          This method returns an array of Memories.
 void remove(MemoryInterface m)
          This method removes a Memory from the Memory Manager.
 void setEndian(boolean endian)
          This method sets the endian (byte order) of the memory system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values
Constructor Detail

MemoryManager

public MemoryManager()
Method Detail

getEndian

public boolean getEndian()
This method returns the endian (byte order) of the memory system.

Returns:
This method returns the endian (byte order) of the processors memory system.

setEndian

public void setEndian(boolean endian)
This method sets the endian (byte order) of the memory system.

Parameters:
endian - The endian (either Memory.BIG or Memory.LITTLE).

get

public MemoryInterface get(int addr)
This method returns the memory associated with an address. If this address does not map to any Memory in this Memory Manager, a null is returned.

Parameters:
addr - The address.
Returns:
This method returns the memory associated with an address. If this address does not map to any Memory in this Memory Manager, a null is returned.

add

public void add(MemoryInterface m)
This method adds a Memory to the Memory manager. Note that no checking for things such as address overlap are performed. It is the responsibility of the caller to be sure that a valid memory system is specified.

Parameters:
m - The memory.

remove

public void remove(MemoryInterface m)
This method removes a Memory from the Memory Manager.

Parameters:
m - The memory.

getMemories

public MemoryInterface[] getMemories()
This method returns an array of Memories.

Returns:
This method returns an array of Memories.

dump

public java.lang.String dump()
This method prints status information about the Memory system.