net.charlesames.music.score
Class SegmentEnd

java.lang.Object
  extended by net.charlesames.utility.common.Disposable
      extended by net.charlesames.utility.entity.Entity
          extended by net.charlesames.utility.entity.WriteableEntity
              extended by net.charlesames.music.score.ScoreEntity
                  extended by net.charlesames.music.score.ScoreEvent
                      extended by net.charlesames.music.score.SegmentEnd
All Implemented Interfaces:
EntityContainer

public class SegmentEnd
extends ScoreEvent

The SegmentEnd subclass of ScoreEvent marks the end of a contour segment within a particular voice of the score. The parent of a SegmentEnd is a ScoreSegment.

Author:
Charles Ames

Nested Class Summary
 
Nested classes/interfaces inherited from class net.charlesames.music.score.ScoreEvent
ScoreEvent.Alignment
 
Method Summary
 ScoreEvent copy(Score targetScore, Ratio offset, net.charlesames.music.score.MergeMap mergeMap)
          Copy this ScoreEvent to the target score.
static XmlSpec createXmlSpec()
          Create an XML specification for the SegmentEnd class.
 void dumpSpecific()
          Print out event details to System.out.
 boolean equals(ScoreEntity other)
          Check if this entity has the same class and content as another entity.
static SegmentEnd fromXmlNode(org.w3c.dom.Element element, Score score)
          Create a new SegmentEnd event and fill in its data from an XML element.
 ScoreEvent.Alignment getAlignment()
          Get the Alignment.
 int getPriority()
          Get the Priority.
 ScoreSegment getSegment()
          Get the segment reference.
 void wipe()
          Release resources engaged by this entity.
 void writeMusicXml(MeasureInPart measureInPart)
          Convert this event into a MusicXML element.
 
Methods inherited from class net.charlesames.music.score.ScoreEvent
checkTime, createXmlSpec, dump, equals, getContainer, getOnset, getPeriod, getProcessID, getRelease, getText, getVoice, setProcessID
 
Methods inherited from class net.charlesames.music.score.ScoreEntity
copyToClipboard, createXmlSpec, getScore, toString
 
Methods inherited from class net.charlesames.utility.entity.WriteableEntity
check, clearXmlSpecs, createXmlSpec, getTagName, getXmlData, getXmlSpec, getXmlSpec, initializeXsd, isPersistent, logError, logError, makeDirty, putXmlData, save, setID, setName, setPersistent, setStatus, toXmlNode
 
Methods inherited from class net.charlesames.utility.entity.Entity
decrementReferenceCount, dereferenceHandle, dispose, equals, getHandle, getID, getName, getPath, getReferenceCount, getStatus, hasContainer, incrementReferenceCount, isModifiable, methodHasOverride, predecessor, resequenceEntities, setContainer, setModifiable, shiftEntitiesDown, shiftEntityDown, shiftEntityUp, successor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSegment

public ScoreSegment getSegment()
Get the segment reference.

Returns:
The segment reference.

getPriority

public int getPriority()
Description copied from class: ScoreEvent
Get the Priority. The Priority determines sequential preference when two events happen at the same time.

Specified by:
getPriority in class ScoreEvent
Returns:
The Priority.

getAlignment

public ScoreEvent.Alignment getAlignment()
Description copied from class: ScoreEvent
Get the Alignment. The Alignment property determines whether an event at the barline should be considered as part of the preceding measure (Alignment.RIGHT) or the succeeding measure (Alignment.LEFT).

Specified by:
getAlignment in class ScoreEvent
Returns:
The Alignment.

writeMusicXml

public void writeMusicXml(MeasureInPart measureInPart)
Description copied from class: ScoreEvent
Convert this event into a MusicXML element.

Overrides:
writeMusicXml in class ScoreEvent
Parameters:
measureInPart - The MusicXml container for the new element.

copy

public ScoreEvent copy(Score targetScore,
                       Ratio offset,
                       net.charlesames.music.score.MergeMap mergeMap)
Description copied from class: ScoreEvent
Copy this ScoreEvent to the target score.

Specified by:
copy in class ScoreEvent
Returns:
The ScoreEvent newly created in the target score.

wipe

public void wipe()
Description copied from class: ScoreEvent
Release resources engaged by this entity.

Overrides:
wipe in class ScoreEvent

fromXmlNode

public static SegmentEnd fromXmlNode(org.w3c.dom.Element element,
                                     Score score)
Create a new SegmentEnd event and fill in its data from an XML element.

Parameters:
element - An XML element describing a contour segment-end event.
score - The Score which will contain the contour segment-end event.
Returns:
The newly created SegmentEnd instance.

createXmlSpec

public static XmlSpec createXmlSpec()
Create an XML specification for the SegmentEnd class.

Returns:
The newly created XmlSpec instance.
Throws:
java.lang.RuntimeException - when an XmlSpec instance already exists for the SegmentEnd class.

dumpSpecific

public void dumpSpecific()
Description copied from class: ScoreEvent
Print out event details to System.out. The calling method is responsible for line termination.

Overrides:
dumpSpecific in class ScoreEvent

equals

public boolean equals(ScoreEntity other)
Description copied from class: ScoreEntity
Check if this entity has the same class and content as another entity.

Overrides:
equals in class ScoreEntity
Parameters:
other - The other entity.
Returns:
True if the two entities have the same class and content; false otherwise.