Class CompoundVertex

java.lang.Object
  |
  +--MusicVertex
        |
        +--CompoundVertex

public class CompoundVertex
extends MusicVertex

A CompoundVertex represents a subgraph which we have chosen to see as a unit.


Field Summary
 GraphProductionRule productionRule
          The graph production rule which arises from the substitution of the subgraph with this CompoundVertex; in graph-grammar terms, this CompoundVertex may be said to *produce* its inner Subgraph.
 SimMeasureResult smr
          The similarity measure result which describes the quality of the SimilarityStatement in which the inner Subgraph of this CompoundVertex was found to be similar to something else.
 Subgraph subgraph
          The Subgraph contained in this CompoundVertex.
 
Fields inherited from class MusicVertex
inEdges, lowerRightPosition, maxDistanceFromEnd, maxDistanceFromStart, minDistanceFromEnd, minDistanceFromStart, objectTimeStamp, outEdges, starttime, upperLeftPosition, useCounter
 
Constructor Summary
CompoundVertex(Subgraph s, double start, long time, GraphProductionRule gprule, SimMeasureResult smresult)
           
 
Method Summary
 MusicVertex deepClone()
          Returns a CompoundVertex whose inner subgraph has been deepCloned.
 int getIndexOf(MusicVertex mv)
          Returns the index of MusicVertex mv if it is contained in the inner subgraph of this CompoundVertex.
 double getLength()
          The length of this CompoundVertex is the largest end-time of MusicVertices (be they simple or compound) inside the inner Subgraph of this CompoundVertex minus the smallest start-time inside the inner subgraph.
 SimpleVertex resolveAnchor(java.util.Vector anchor)
          Anchor resolution on a CompoundVertex recursively finds the SimpleVertex determined by the Vector of Integers that is input as a parameter.
 java.lang.String toString()
          Writes a one-line description of this CompoundVertex.
 java.lang.String toStringWithSubgraph()
          Writes a longer description of this CompoundVertex, including also a toString of the inner subgraph.
 
Methods inherited from class MusicVertex
distToString, getEndtime, getFollowsEdges, getProperFollowInEdges, getProperFollowOutEdges, getProperSimultaneousInEdges, getProperSimultaneousOutEdges, getProperStrongFollowInEdges, getProperStrongFollowOutEdges, getProperStrongSimultaneousInEdges, getProperStrongSimultaneousOutEdges, getProperWeakFollowInEdges, getProperWeakFollowOutEdges, getProperWeakSimultaneousInEdges, getProperWeakSimultaneousOutEdges, getSimultaneousEdges, getStrongFollowsEdges, getStrongSimultaneousEdges, graphicLayoutDone, graphPosToString, isSink, isSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subgraph

public Subgraph subgraph
The Subgraph contained in this CompoundVertex.


productionRule

public GraphProductionRule productionRule
The graph production rule which arises from the substitution of the subgraph with this CompoundVertex; in graph-grammar terms, this CompoundVertex may be said to *produce* its inner Subgraph.


smr

public SimMeasureResult smr
The similarity measure result which describes the quality of the SimilarityStatement in which the inner Subgraph of this CompoundVertex was found to be similar to something else. This is used in the SimSegmenter. From the SimMeasureResult, we can know which SimilarityMeasure was used.

Constructor Detail

CompoundVertex

public CompoundVertex(Subgraph s,
                      double start,
                      long time,
                      GraphProductionRule gprule,
                      SimMeasureResult smresult)
Method Detail

getLength

public double getLength()
The length of this CompoundVertex is the largest end-time of MusicVertices (be they simple or compound) inside the inner Subgraph of this CompoundVertex minus the smallest start-time inside the inner subgraph.

Specified by:
getLength in class MusicVertex

deepClone

public MusicVertex deepClone()
Returns a CompoundVertex whose inner subgraph has been deepCloned. The Vectors of in- and out-edges are not cloned, they need to be set from the outside, since deepCloning is intended to create a new CompoundVertex used in a new music graph, so the new CompoundVertex should point to edges of this new graph instead of those from the original music graph. This is a tricky part of the MusicGraph.deepClone() method.

Specified by:
deepClone in class MusicVertex

toString

public java.lang.String toString()
Writes a one-line description of this CompoundVertex.

Overrides:
toString in class java.lang.Object

toStringWithSubgraph

public java.lang.String toStringWithSubgraph()
Writes a longer description of this CompoundVertex, including also a toString of the inner subgraph.


resolveAnchor

public SimpleVertex resolveAnchor(java.util.Vector anchor)
Anchor resolution on a CompoundVertex recursively finds the SimpleVertex determined by the Vector of Integers that is input as a parameter.

Specified by:
resolveAnchor in class MusicVertex

getIndexOf

public int getIndexOf(MusicVertex mv)
Returns the index of MusicVertex mv if it is contained in the inner subgraph of this CompoundVertex.