public class ExportResult
extends java.lang.Object
This class is used to collect export warnings for a later display. A MIDI sequence can not always be transformed into source code properly. Warnings regarding such problems are collected and sorted here in order to be displayed later.
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.String,java.lang.Object> |
lastWarning |
private int |
numberOfWarnings |
private boolean |
success |
private java.util.TreeMap<java.lang.Long,java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.Object>>> |
warningMap |
Constructor and Description |
---|
ExportResult(boolean success)
Creator of an empty warning object.
|
Modifier and Type | Method and Description |
---|---|
void |
addWarning(java.lang.Integer track,
long tick,
java.lang.Byte channel,
java.lang.String msg)
Adds a new warning message.
|
int |
countWarnings()
Returns the number of warnings.
|
java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.Object>> |
getWarnings()
Returns a data structure containing all warnings, sorted by tick.
|
boolean |
isSuccessful()
Returns true, if the export was successful, otherwise false.
|
void |
setDetailsOfLastWarning(SingleMessage msg)
Adds MIDI message details to the last warning.
|
void |
setDetailsOfLastWarning(java.lang.String details)
Adds a custom details string to the last warning.
|
private java.util.TreeMap<java.lang.Long,java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.Object>>> warningMap
private int numberOfWarnings
private boolean success
private java.util.HashMap<java.lang.String,java.lang.Object> lastWarning
public ExportResult(boolean success)
Creator of an empty warning object. Initializes a new empty data structure for warnings.
success
- false, if the export failed. Otherwise: true.public void addWarning(java.lang.Integer track, long tick, java.lang.Byte channel, java.lang.String msg)
Adds a new warning message.
track
- Track number of the event that caused the warning, or null if unknown.tick
- Tickstamp of the event that caused the warning.channel
- Channel where the warning occured – or null if it wasn’t a channel based event.msg
- Warning messagepublic void setDetailsOfLastWarning(SingleMessage msg)
Adds MIDI message details to the last warning.
msg
- the message detailspublic void setDetailsOfLastWarning(java.lang.String details)
Adds a custom details string to the last warning.
details
- the custom details to be added.public java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.Object>> getWarnings()
Returns a data structure containing all warnings, sorted by tick. Each tick where at least one warning occured has an entry. The ArrayList
for each tick contains a HashMap
for each warning. Each HashMap
contains the details of the warning.
public int countWarnings()
Returns the number of warnings.
public boolean isSuccessful()
Returns true, if the export was successful, otherwise false.