Class SgsActionEvent
java.lang.Object
org.jjazz.songstructure.api.event.SgsChangeEvent
org.jjazz.songstructure.api.event.SgsActionEvent
- Direct Known Subclasses:
SongMetaEvents.SgsSourceActionEvent
An event to indicate that a high-level action, i.e. a call to a public API method that mutates the song structure, has started or is complete.
All low-level SgsChangeEvents fired by a SongStructure are always preceded and followed by start and complete SgsActionEvents. The complete SgsActionEvent contains the low-level SgsChangeEvents.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThis corresponds to public API methods that can mutate a SongStructure. -
Constructor Summary
ConstructorsConstructorDescriptionSgsActionEvent(SongStructure src, SgsActionEvent.API_ID apiId, Object data) Create a SgsActionEvent in started state, with no subEvents. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a SgsChangeEvent to this SgsActionEvent.voidcomplete()Mark this SgsActionEvent as complete.getApiId()getData()Optional data associated to the event.The lower-level SgsChangeEvents added to this instance.booleanCheck if complete() was called.toString()Methods inherited from class org.jjazz.songstructure.api.event.SgsChangeEvent
getSongPart, getSongParts, getSource, sortSongParts
-
Constructor Details
-
SgsActionEvent
Create a SgsActionEvent in started state, with no subEvents.- Parameters:
src-apiId-data- An optional data associated to the event
-
-
Method Details
-
getApiId
-
isComplete
public boolean isComplete()Check if complete() was called.- Returns:
- See Also:
-
complete
public void complete()Mark this SgsActionEvent as complete.- See Also:
-
addSubEvent
Add a SgsChangeEvent to this SgsActionEvent.- Parameters:
e- Can not be a SgsActionEvent
-
getSubEvents
The lower-level SgsChangeEvents added to this instance.- Returns:
- An unmodifiable list. Can be empty.
-
getData
Optional data associated to the event.Each actionId can have it own kind of data. Check SongStructureImpl.java code to know which data is available.
- Returns:
- Can be null.
-
toString
-