Class MusicEdge

java.lang.Object
  |
  +--MusicEdge

public class MusicEdge
extends java.lang.Object

A MusicEdge is one of the two most basic components of a MusicGraph, the other being the MusicVertex. Music edges may have different kinds, represented using the very important integer attribute 'edgetype'. Different edge types could have been modeled as subclasses of an abstract class MusicEdge, but we have chosen the primitive way to represent the different types. A MusicEdge is directed, pointing both to a 'from'- and a 'to'-MusicVertex.


Field Summary
 int edgetype
          The attribute edgetype is a way to distinguish between different kinds of edges, eg. edges that represent temporal 'follows' relations between notes, and edges that represent notes that are played simultaneously (temporal 'equals' relation).
static int FOLLOWS
          Edge type FOLLOWS (=strong FOLLOW)
 MusicVertex from
          The MusicVertex that this MusicEdge departs from.
 java.util.Vector fromAnchorVector
          A Vector of Integers describing the indices of MusicVertices inside CompoundVertices that we have to peel through to get to the SimpleVertex which is the anchor at the 'from'-end of this MusicEdge.
 java.awt.Point fromPoint
          The point in the graphical layout, where this edges starts.
static int MATCH
          Edge type MATCH, used for the matching of MusicVertex pairs in the allMatches Vector, which is an attribute in class NSSMVertexResult.
static int SIMULTANEOUS
          Edge type SIMULTANEOUS (=strong SIMULTANEOUS)
 MusicVertex to
          The MusicVertex that this MusicEdge arrives to.
 java.util.Vector toAnchorVector
          A Vector of Integers describing the indices of MusicVertices inside CompoundVertices that we have to peel through to get to the SimpleVertex which is the anchor at the 'to'-end of this MusicEdge.
 java.awt.Point toPoint
          The point in the graphical layout, where this edges ends.
static int WEAKFOLLOWS
          Edge type WEAKFOLLOWS
static int WEAKSIMULTANEOUS
          Edge type WEAKSIMULTANEOUS
 
Constructor Summary
MusicEdge(MusicVertex f, MusicVertex s, int kind, java.util.Vector fanch, java.util.Vector tanch)
          Constructor edges between simple and/or compound vertices.
MusicEdge(SimpleVertex f, SimpleVertex t, int kind)
          Constructor for edges between simple vertices.
 
Method Summary
 java.util.Vector cloneFromAnchorVector()
          Returns a clone of the Vector describing the from-anchor.
 java.util.Vector cloneToAnchorVector()
          Returns a clone of the Vector describing the to-anchor.
 SimpleVertex fromAnchor()
          Resolves and returns the from-anchor of this MusicEdge.
 boolean graphicLayoutDone()
          Returns true if this MusicEdge has been given graphical layout.
 boolean isFollowEdge()
           
 boolean isMatchingEdge()
          As yet, matching edges should not occur in graphs.
 boolean isSimultaneousEdge()
           
 boolean isStrongFollowEdge()
           
 boolean isStrongSimultaneousEdge()
           
 boolean isWeak()
          Returns true if edgetype==WEAKFOLLOWS or edgetype==WEAKSIMULTANEOUS.
 SimpleVertex toAnchor()
          Resolves and returns the to-anchor of this MusicEdge.
 java.lang.String toString()
           
 java.lang.String toStringWithAnchors()
          Includes toStrings of the anchors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

edgetype

public int edgetype
The attribute edgetype is a way to distinguish between different kinds of edges, eg. edges that represent temporal 'follows' relations between notes, and edges that represent notes that are played simultaneously (temporal 'equals' relation).


FOLLOWS

public static final int FOLLOWS
Edge type FOLLOWS (=strong FOLLOW)

See Also:
Constant Field Values

SIMULTANEOUS

public static final int SIMULTANEOUS
Edge type SIMULTANEOUS (=strong SIMULTANEOUS)

See Also:
Constant Field Values

MATCH

public static final int MATCH
Edge type MATCH, used for the matching of MusicVertex pairs in the allMatches Vector, which is an attribute in class NSSMVertexResult.

See Also:
Constant Field Values

WEAKFOLLOWS

public static final int WEAKFOLLOWS
Edge type WEAKFOLLOWS

See Also:
Constant Field Values

WEAKSIMULTANEOUS

public static final int WEAKSIMULTANEOUS
Edge type WEAKSIMULTANEOUS

See Also:
Constant Field Values

fromPoint

public java.awt.Point fromPoint
The point in the graphical layout, where this edges starts.


toPoint

public java.awt.Point toPoint
The point in the graphical layout, where this edges ends.


from

public MusicVertex from
The MusicVertex that this MusicEdge departs from.


to

public MusicVertex to
The MusicVertex that this MusicEdge arrives to.


fromAnchorVector

public java.util.Vector fromAnchorVector
A Vector of Integers describing the indices of MusicVertices inside CompoundVertices that we have to peel through to get to the SimpleVertex which is the anchor at the 'from'-end of this MusicEdge.


toAnchorVector

public java.util.Vector toAnchorVector
A Vector of Integers describing the indices of MusicVertices inside CompoundVertices that we have to peel through to get to the SimpleVertex which is the anchor at the 'to'-end of this MusicEdge.

Constructor Detail

MusicEdge

public MusicEdge(SimpleVertex f,
                 SimpleVertex t,
                 int kind)
Constructor for edges between simple vertices. Anchor information is generated automatically.


MusicEdge

public MusicEdge(MusicVertex f,
                 MusicVertex s,
                 int kind,
                 java.util.Vector fanch,
                 java.util.Vector tanch)
Constructor edges between simple and/or compound vertices. Includes anchor information.

Method Detail

fromAnchor

public SimpleVertex fromAnchor()
Resolves and returns the from-anchor of this MusicEdge.


toAnchor

public SimpleVertex toAnchor()
Resolves and returns the to-anchor of this MusicEdge.


graphicLayoutDone

public boolean graphicLayoutDone()
Returns true if this MusicEdge has been given graphical layout.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringWithAnchors

public java.lang.String toStringWithAnchors()
Includes toStrings of the anchors.


isStrongFollowEdge

public boolean isStrongFollowEdge()

isStrongSimultaneousEdge

public boolean isStrongSimultaneousEdge()

isFollowEdge

public boolean isFollowEdge()

isSimultaneousEdge

public boolean isSimultaneousEdge()

isWeak

public boolean isWeak()
Returns true if edgetype==WEAKFOLLOWS or edgetype==WEAKSIMULTANEOUS.


isMatchingEdge

public boolean isMatchingEdge()
As yet, matching edges should not occur in graphs. We may decide to let them later on. They are used as a data structure for MusicVertex pairwise matching.


cloneFromAnchorVector

public java.util.Vector cloneFromAnchorVector()
Returns a clone of the Vector describing the from-anchor.


cloneToAnchorVector

public java.util.Vector cloneToAnchorVector()
Returns a clone of the Vector describing the to-anchor.