|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.loconet.sdf.SdfMacro
public abstract class SdfMacro
Common base for all the SDF macros defined by Digitrax for their sound definition language
Each macro has a number of descriptive forms:
SdfMacro and its subclasses don't do the notification needed to be Models in an MVC edit paradyme. This is because there are a lot of SdfMacros in realistic sound file, and the per-object overhead needed would be too large. Hence (or perhaps because of no need), there is no support for simultaneous editing of a single macro instruction updating multiple windows. You can have multiple editors open on a single SdfBuffer, but these are not interlocked against each other. (We could fix this by having a shared pool of "objects to be notified of changes in the SdfBuffer, acccessed by reference during editing (to avoid another dependency), but that's a project for another day)
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
SdfMacro()
|
|
| Method Summary | |
|---|---|
abstract String |
allInstructionString(String indent)
Provide instructions in MPASM format, including the trailing newline and all nested instructions. |
static SdfMacro |
decodeInstruction(SdfBuffer buff)
Return the next instruction macro in a buffer. |
List<SdfMacro> |
getChildren()
Access child (nested) instructions. |
abstract int |
length()
Provide number of bytes defined by this macro |
void |
loadByteArray(SdfBuffer buffer)
Store into a buffer. |
abstract String |
name()
Name used by the macro in the SDF definition |
abstract String |
oneInstructionString()
Provide single instruction in MPASM format, including the trailing newline. |
abstract String |
toString()
Provide a single-line simplified representation, including the trailing newline. |
int |
totalLength()
Total length, including contained instructions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SdfMacro()
| Method Detail |
|---|
public abstract String name()
public abstract int length()
public abstract String toString()
EditorFrame.
toString in class Objectpublic abstract String oneInstructionString()
public abstract String allInstructionString(String indent)
indent - String inserted at the start of each output line,
typically some number of spaces.
public List<SdfMacro> getChildren()
public int totalLength()
public void loadByteArray(SdfBuffer buffer)
This provides a default implementation for children, but each subclass needs to store it's own data with setAtIndexAndInc()
public static SdfMacro decodeInstruction(SdfBuffer buff)
Note this uses the index contained in the SdfBuffer implementation, and has the side-effect of bumping that forward.
buff - The SdfBuffer being scanned for instruction macros.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||