|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MusicGraph | +--Subgraph
A Subgraph is basically a subset of vertices and a subset of edges
of some MotherGraph
. The Subgraph class is abstract
because in the SimFinder system, a subgraph is either sequential
(SeqSubgraph
) or non-sequential (NonSeqSubgraph
). The two kinds do have some common properties and
methods, though, and these are described in this abstract Subgraph
class.
Field Summary | |
protected MotherGraph |
mothergraph
The MotherGraph that owns the vertices and edges pointed to by this Subgraph. |
Fields inherited from class MusicGraph |
edges, title, vertices |
Constructor Summary | |
Subgraph()
|
Method Summary | |
void |
addVertexAndNecessaryEdges(MusicVertex mv,
MusicEdge me)
Adds a given MusicVertex mv and a MusicEdge me
to this Subgraph along with any MusicEdges in the MotherGraph
that connect mv to the rest of this Subgraph. |
abstract void |
extend(int times)
Extends this subgraph by randomly adding to it a MusicVertex which is connected to this subgraph in its mother
graph. |
MusicEdge |
findEdgeConnectingToVertex(MusicVertex mv)
If mv is outside this subgraph, and there is an edge e in the mothergraph connecting mv to some vertex in this subgraph, this method returns e, otherwise null. |
java.util.Vector |
getAllProperFollowInEdges(boolean includeWeakEdges)
Returns a Vector of Vector of MusicEdge ; the Vector of
MusicEdges at index i in the returned Vector contains the
proper follow in-edges of MusicVertex i in this Subgraph;
proper follow in-edges are follow in-edges to the given vertex
that are also contained in this Subgraph. |
java.util.Vector |
getAllProperFollowOutEdges(boolean includeWeakEdges)
Returns a Vector of Vector of MusicEdge ; the Vector of
MusicEdges at index i in the returned Vector contains the
proper follow out-edges of MusicVertex i in this Subgraph;
proper follow out-edges are follow out-edges to the given
vertex that are also contained in this Subgraph. |
java.util.Vector |
getAllProperInEdges(boolean includeWeakEdges)
Returns a Vector of Vector of MusicEdge ; the Vector of
MusicEdges at index i in the returned Vector contains the
proper in-edges of MusicVertex i in this Subgraph; proper
in-edges are in-edges to the given vertex that are also
contained in this Subgraph. |
java.util.Vector |
getAllProperOutEdges(boolean includeWeakEdges)
Returns a Vector of Vector of MusicEdge ; the Vector of
MusicEdges at index i in the returned Vector contains the
proper out-edges of MusicVertex i in this Subgraph; proper
out-edges are out-edges to the given vertex that are also
contained in this Subgraph. |
java.util.Vector |
getAllSons(java.util.Vector vert)
Returns a Vector of MusicVertex which follow upon any
of the music vertices in the input vector, i.e. there is a
FOLLOWS MusicEdge from the vertex in the input vector
to the one in the output vector. |
java.util.Vector |
getFollowEdges()
Returns a Vector of all FOLLOW edges in this Subgraph. |
abstract int |
getLeftExtensibility()
Returns how many times this Subgraph may be extended to the left. |
MotherGraph |
getMotherGraph()
Returns the MotherGraph of this Subgraph. |
abstract double |
getMothergraphCoverage()
|
abstract int |
getRightExtensibility()
Returns how many times this Subgraph may be extended to the right. |
jm.music.data.Score |
getScore()
Returns the Score object that the MotherGraph of this Subgraph originated from. |
java.util.Vector |
getSimultaneousEdges()
Returns a Vector of all SIMULTANEOUS edges in this Subgraph. |
java.util.Vector |
getStrongFollowEdges()
Returns a Vector of all strong FOLLOW edges in this Subgraph. |
java.util.Vector |
getStrongSimultaneousEdges()
Returns a Vector of all strong SIMULTANEOUS edges in this Subgraph. |
boolean |
isStrongSequential()
Returns true if this Subgraph is sequential with only strong FOLLOW edges. |
abstract int |
numberOfLeftmostRests()
|
abstract int |
numberOfRightmostRests()
|
void |
printTheScore(java.lang.String label)
For debugging. |
void |
removeVertexAndConnectedEdges(MusicVertex mv)
Removes a given MusicVertex mv from this Subgraph
along with any MusicEdges that connected mv to the rest of
this Subgraph. |
abstract void |
shorten(int times)
Shortens this subgraph by randomly choosing and removing a MusicVertex and the edge(s) that connected it to the
rest of this subgraph. |
abstract void |
slide(int times)
Slides this Subgraph either left or right a number of times. |
java.lang.String |
toString()
Returns a string with the toString's of all vertices and edges in this MusicGraph. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected MotherGraph mothergraph
Constructor Detail |
public Subgraph()
Method Detail |
public boolean isStrongSequential()
public java.lang.String toString()
MusicGraph
toString
in class MusicGraph
public abstract int getLeftExtensibility()
public abstract int getRightExtensibility()
public abstract void extend(int times) throws java.lang.Exception
MusicVertex
which is connected to this subgraph in its mother
graph. The edge connecting them is also added.
java.lang.Exception
public abstract void shorten(int times) throws java.lang.Exception
MusicVertex
and the edge(s) that connected it to the
rest of this subgraph. Only vertices that do not split this
graph may be removed.
java.lang.Exception
public abstract void slide(int times) throws java.lang.Exception
java.lang.Exception
public java.util.Vector getAllSons(java.util.Vector vert)
MusicVertex
which follow upon any
of the music vertices in the input vector, i.e. there is a
FOLLOWS MusicEdge
from the vertex in the input vector
to the one in the output vector.
public java.util.Vector getAllProperFollowInEdges(boolean includeWeakEdges)
MusicEdge
; the Vector of
MusicEdges at index i in the returned Vector contains the
proper follow in-edges of MusicVertex i in this Subgraph;
proper follow in-edges are follow in-edges to the given vertex
that are also contained in this Subgraph.
getAllProperFollowInEdges
in class MusicGraph
public java.util.Vector getAllProperFollowOutEdges(boolean includeWeakEdges)
MusicEdge
; the Vector of
MusicEdges at index i in the returned Vector contains the
proper follow out-edges of MusicVertex i in this Subgraph;
proper follow out-edges are follow out-edges to the given
vertex that are also contained in this Subgraph.
getAllProperFollowOutEdges
in class MusicGraph
public java.util.Vector getAllProperInEdges(boolean includeWeakEdges)
MusicEdge
; the Vector of
MusicEdges at index i in the returned Vector contains the
proper in-edges of MusicVertex i in this Subgraph; proper
in-edges are in-edges to the given vertex that are also
contained in this Subgraph.
getAllProperInEdges
in class MusicGraph
public java.util.Vector getAllProperOutEdges(boolean includeWeakEdges)
MusicEdge
; the Vector of
MusicEdges at index i in the returned Vector contains the
proper out-edges of MusicVertex i in this Subgraph; proper
out-edges are out-edges to the given vertex that are also
contained in this Subgraph.
getAllProperOutEdges
in class MusicGraph
public jm.music.data.Score getScore()
getScore
in class MusicGraph
public MotherGraph getMotherGraph()
getMotherGraph
in class MusicGraph
public void printTheScore(java.lang.String label)
public java.util.Vector getStrongFollowEdges()
public java.util.Vector getFollowEdges()
public java.util.Vector getStrongSimultaneousEdges()
public java.util.Vector getSimultaneousEdges()
public abstract double getMothergraphCoverage()
public abstract int numberOfLeftmostRests()
public abstract int numberOfRightmostRests()
public void removeVertexAndConnectedEdges(MusicVertex mv)
MusicVertex
mv from this Subgraph
along with any MusicEdges that connected mv to the rest of
this Subgraph.
public void addVertexAndNecessaryEdges(MusicVertex mv, MusicEdge me)
MusicVertex
mv and a MusicEdge
me
to this Subgraph along with any MusicEdges in the MotherGraph
that connect mv to the rest of this Subgraph.
public MusicEdge findEdgeConnectingToVertex(MusicVertex mv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |