|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Hardware
Generic hardware interface.
Every class involved in the simulator must implements this interface, the structure is like a tree and every Hardware have zero or more children.
Normally the children depend from the parent. For example a Simulator have one CPU children, the CPU one Disk Controller and the Disk Controller 4 Harddisk. This type of link is checked at runtime and is responsability of the implementation to add correct children class.
To permit serialization every hardware instance must add children in the init method after have verified that children is not present, this is not so comfortable but permit to use the XML Enmcoder/Decoder to configure new system using simple text file.
It is very important to make all the initialization in the iniit() method and not in the constructor, the constructor can only call method to set and get properties.
init(jmce.sim.Hardware)
Method Summary | |
---|---|
Hardware |
addHardware(Hardware h)
Add a new child. |
void |
destroy()
Destroy the device. |
Hardware[] |
getHardware()
|
Hardware |
getHardware(java.lang.Class clazz)
Get the first child of the specified Class. |
Hardware |
getHardware(java.lang.Class clazz,
int n)
Get the n occuurence of the specified class. |
Hardware |
getHardware(int n)
|
int |
getHardwareCount()
Return the number of child |
java.lang.Object[] |
getHardwareInstances(java.lang.Class c)
Return one array with all instance of the specified Class |
Hardware |
getHardwareTree(java.lang.Class... classes)
Return a class walking the current Hardware as a tree. |
java.lang.String |
getName()
Return the name. |
Hardware |
getParent()
Return the parent |
void |
init(Hardware parent)
Initialize the hardware. |
void |
initSwing(Hardware parent)
initialize if present the swing hardware. |
void |
removeHardware(Hardware h)
Remove one child if present. |
void |
removeHardware(int n)
Remove the child at postion. |
void |
reset()
Reset the the device to the initial state. |
void |
setHardware(Hardware[] h)
|
void |
setHardware(int n,
Hardware h)
|
void |
setName(java.lang.String name)
Set the name. |
Method Detail |
---|
void setName(java.lang.String name)
java.lang.String getName()
void init(Hardware parent) throws SIMException
parent
- Parent of this hardware.
SIMException
void initSwing(Hardware parent) throws SIMException
Hardware
implementing
SwingHardware.
parent
- - Parent Hardware
SIMException
SwingHardware
void reset() throws SIMException
SIMException
void destroy() throws SIMException
SIMException
Hardware getParent()
Hardware addHardware(Hardware h)
int getHardwareCount()
void removeHardware(Hardware h)
void removeHardware(int n)
java.lang.Object[] getHardwareInstances(java.lang.Class c)
Hardware getHardwareTree(java.lang.Class... classes)
classes
- - List of class to search.Hardware getHardware(java.lang.Class clazz)
clazz
- Class of the object to be retrivied.
Hardware getHardware(java.lang.Class clazz, int n)
clazz
- Class to be retrivied.n
- Occurence.
void setHardware(int n, Hardware h)
Hardware getHardware(int n)
Hardware[] getHardware()
void setHardware(Hardware[] h)
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |