net.sourceforge.geeboss.model.midi.memory
Class MemoryObject

java.lang.Object
  extended by net.sourceforge.geeboss.model.midi.memory.MemoryComponent
      extended by net.sourceforge.geeboss.model.midi.memory.MemoryObject
All Implemented Interfaces:
Referencing, Sysexable
Direct Known Subclasses:
Effect, MappedDevice, Patch, PatchChain, PatchName

public class MemoryObject
extends MemoryComponent
implements Referencing

An object memory component

Author:
Frederic BORRY

Field Summary
protected  MemoryMap mMemoryMap
          Referenced objects
 
Fields inherited from class net.sourceforge.geeboss.model.midi.memory.MemoryComponent
mAbsoluteAddress, mBaseAddress, mName, mParent, mSize
 
Constructor Summary
MemoryObject(java.lang.String name, MemoryObject parent, long baseAddress, long size)
          Create a new MemoryObject given it's name, baseAddress and it's size
 
Method Summary
 void addReference(Reference reference, MemoryManager manager)
          Add a reference to this Referencing object
 void fromSysex(SysexMemoryMessage message, java.util.List<MemoryComponent> updated)
          Load this Syseable object from a sysex memory message
 MemoryComponent getComponent(java.lang.String path)
          Returns the memory component associated to the provided path
protected static void handleClassCastException(java.lang.String componentName, java.lang.Class componentClass, java.lang.ClassCastException exception)
          Handle a class cast exception
 boolean isValue()
          Returns false if this MemoryComponent's implementation is a value (data)
 void setup()
          Setup this object after references have been added.
 void toSysex(java.util.List<SysexMemoryMessage> messages)
          Dump this Sysexable object into a sysex memory message list
 
Methods inherited from class net.sourceforge.geeboss.model.midi.memory.MemoryComponent
getAbsoluteAddress, getBaseAddress, getName, getParent, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mMemoryMap

protected MemoryMap mMemoryMap
Referenced objects

Constructor Detail

MemoryObject

public MemoryObject(java.lang.String name,
                    MemoryObject parent,
                    long baseAddress,
                    long size)
Create a new MemoryObject given it's name, baseAddress and it's size

Parameters:
name - the memory object name
parent - the parent memory object
baseAddress - the memory object base address
size - the memory object size
Method Detail

getComponent

public MemoryComponent getComponent(java.lang.String path)
Returns the memory component associated to the provided path

Parameters:
path - the dot seperated path the the memory component
Returns:
the memory component associated to the provided path
Throws:
java.lang.IllegalArgumentException - if no object was found of if the path is not well formed

isValue

public boolean isValue()
Returns false if this MemoryComponent's implementation is a value (data)

Specified by:
isValue in class MemoryComponent
Returns:
true if this MemoryComponent's implementation is a value (data)

setup

public void setup()
Setup this object after references have been added.


fromSysex

public void fromSysex(SysexMemoryMessage message,
                      java.util.List<MemoryComponent> updated)
Load this Syseable object from a sysex memory message

Specified by:
fromSysex in interface Sysexable
Parameters:
message - the sysex memory message to load the object from
updated - the list of modified memory components

toSysex

public void toSysex(java.util.List<SysexMemoryMessage> messages)
Dump this Sysexable object into a sysex memory message list

Specified by:
toSysex in interface Sysexable
Parameters:
messages - the sysex memory message list to dump the object to

addReference

public void addReference(Reference reference,
                         MemoryManager manager)
Add a reference to this Referencing object

Specified by:
addReference in interface Referencing
Parameters:
reference - the reference to add to the Referencing object
manager - the MemoryManager

handleClassCastException

protected static void handleClassCastException(java.lang.String componentName,
                                               java.lang.Class componentClass,
                                               java.lang.ClassCastException exception)
Handle a class cast exception

Parameters:
componentName - the component that was casted
componentClass - the class the component was casted to
exception - the exception


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.