Class NonSeqSubgraph

java.lang.Object
  |
  +--MusicGraph
        |
        +--Subgraph
              |
              +--NonSeqSubgraph

public class NonSeqSubgraph
extends Subgraph

A non-sequential subgraph represents any connected subset of vertices inside a mother graph.


Field Summary
 
Fields inherited from class Subgraph
mothergraph
 
Fields inherited from class MusicGraph
edges, title, vertices
 
Constructor Summary
NonSeqSubgraph(MusicVertex mv, MotherGraph mother)
          Constructs a NonSeqSubgraph with only one MusicVertex.
NonSeqSubgraph(java.lang.String t, MotherGraph mother)
          Neutral constructor for subgraphing.
 
Method Summary
 java.lang.Object clone()
          Returns a shallow clone of this NonSeqSubgraph.
 jm.music.data.Score convertToScore()
          Converts this SeqSubgraph to a Score; includes only notes in this subgraph.
 boolean extend_followIn(MusicVertex mv)
          Tries to extend this non-sequential subgraph along a FOLLOW in-edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.
 boolean extend_followOut(MusicVertex mv)
          Tries to extend this non-sequential subgraph along a FOLLOW out-edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.
 boolean extend_simult(MusicVertex mv)
          Tries to extend this non-sequential subgraph along a SIMULTANEOUS edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.
 void extend(int times)
          Extends this non-sequential subgraph a number of times.
 int getLeftExtensibility()
          Returns how many times this Subgraph may be extended to the left.
 int getMaximalSequentialSubgraphSize()
          Returns the size of the largest possible sequential subgraph of this NonSeqSubgraph.
 double getMothergraphCoverage()
          Deprecated. Not used anymore.
 int getRightExtensibility()
          Returns how many times this Subgraph may be extended to the right.
 int numberOfLeftmostRests()
          Deprecated. Not used anymore.
 int numberOfRightmostRests()
          Deprecated. Not used anymore.
 void shorten(int times)
          Removes a number of MusicVertex's from this non-sequential subgraph; only vertices that do not split this subgraph may be removed.
 void slide(int times)
          It is not as obvious to define sliding for non-sequential subgraphs as it is for sequential subgraphs; this slide-operation simply calls extend(1) and shorten(1).
 NonSeqSubgraph[] splitToPartVoices()
          Returns an array of MusicGraphs that are subgraphs of this graph, each representing a Part from the originating Score; NB: At present, the returned NonSeqSubgraphs may be unconnected (i.e. there can be vertices inside them who are not connected with the rest of the NonSeqSubgraph).
 java.lang.String toString()
          Returns a string with the toString's of all vertices and edges in this MusicGraph.
 
Methods inherited from class Subgraph
addVertexAndNecessaryEdges, findEdgeConnectingToVertex, getAllProperFollowInEdges, getAllProperFollowOutEdges, getAllProperInEdges, getAllProperOutEdges, getAllSons, getFollowEdges, getMotherGraph, getScore, getSimultaneousEdges, getStrongFollowEdges, getStrongSimultaneousEdges, isStrongSequential, printTheScore, removeVertexAndConnectedEdges
 
Methods inherited from class MusicGraph
boolMatrixEqual, boolMatrixMultiply, checkSorting, contains, copyBoolMatrix, deepClone, equals, findVertexAt, getAllPossibleRightExtended, getAllPossibleRightSlides, getAllSequentialSubgraphsOfSize, getAllStrongSequentialSubgraphsOfSize, getBeginningSubgraphSet, getClosure, getMaxEndtime, getMinStarttime, getNestedRestPercentage, getNestedVertexList, getNextGroup, getNSequentialSubgraphsOfSize, getStrongSinks, getStrongSources, getTransitiveClosure, graphicLayoutDone, graphIsConnected, hasInterpartEdges, hasMusedata, initGroupTokenizer, isSimpleGraph, maxUsage, nestedNumberOfRests, nestedNumOfCompoundVertices, nestedSize, nestingDepth, numOfCompoundVertices, overlap, prettyPrintBoolMatrix, printAllDist, size, sortEdges, sortVertexVectorByStarttime, sortVerticesByStarttime, testIntegrity, transitiveClosureOf, vertexAtIndexSplitsSubgraph
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonSeqSubgraph

public NonSeqSubgraph(java.lang.String t,
                      MotherGraph mother)
Neutral constructor for subgraphing.


NonSeqSubgraph

public NonSeqSubgraph(MusicVertex mv,
                      MotherGraph mother)
Constructs a NonSeqSubgraph with only one MusicVertex.

Method Detail

extend

public void extend(int times)
            throws java.lang.Exception
Extends this non-sequential subgraph a number of times.

Specified by:
extend in class Subgraph
java.lang.Exception

extend_followIn

public boolean extend_followIn(MusicVertex mv)
                        throws java.lang.Exception
Tries to extend this non-sequential subgraph along a FOLLOW in-edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.

java.lang.Exception

extend_followOut

public boolean extend_followOut(MusicVertex mv)
                         throws java.lang.Exception
Tries to extend this non-sequential subgraph along a FOLLOW out-edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.

java.lang.Exception

extend_simult

public boolean extend_simult(MusicVertex mv)
                      throws java.lang.Exception
Tries to extend this non-sequential subgraph along a SIMULTANEOUS edge of the MusicVertex mv; returns true if the operation succeeded, otherwise false.

java.lang.Exception

shorten

public void shorten(int times)
             throws java.lang.Exception
Removes a number of MusicVertex's from this non-sequential subgraph; only vertices that do not split this subgraph may be removed.

Specified by:
shorten in class Subgraph
java.lang.Exception

slide

public void slide(int times)
           throws java.lang.Exception
It is not as obvious to define sliding for non-sequential subgraphs as it is for sequential subgraphs; this slide-operation simply calls extend(1) and shorten(1).

Specified by:
slide in class Subgraph
java.lang.Exception

toString

public java.lang.String toString()
Description copied from class: MusicGraph
Returns a string with the toString's of all vertices and edges in this MusicGraph.

Overrides:
toString in class Subgraph

clone

public java.lang.Object clone()
Returns a shallow clone of this NonSeqSubgraph.

Specified by:
clone in class MusicGraph

getLeftExtensibility

public int getLeftExtensibility()
Returns how many times this Subgraph may be extended to the left.

Specified by:
getLeftExtensibility in class Subgraph

getRightExtensibility

public int getRightExtensibility()
Returns how many times this Subgraph may be extended to the right.

Specified by:
getRightExtensibility in class Subgraph

convertToScore

public jm.music.data.Score convertToScore()
Converts this SeqSubgraph to a Score; includes only notes in this subgraph. Assumes that parts are monophonic

Specified by:
convertToScore in class MusicGraph

splitToPartVoices

public NonSeqSubgraph[] splitToPartVoices()
Returns an array of MusicGraphs that are subgraphs of this graph, each representing a Part from the originating Score; NB: At present, the returned NonSeqSubgraphs may be unconnected (i.e. there can be vertices inside them who are not connected with the rest of the NonSeqSubgraph).


getMaximalSequentialSubgraphSize

public int getMaximalSequentialSubgraphSize()
Returns the size of the largest possible sequential subgraph of this NonSeqSubgraph.

Specified by:
getMaximalSequentialSubgraphSize in class MusicGraph

getMothergraphCoverage

public double getMothergraphCoverage()
Deprecated. Not used anymore.

Specified by:
getMothergraphCoverage in class Subgraph

numberOfLeftmostRests

public int numberOfLeftmostRests()
Deprecated. Not used anymore.

Specified by:
numberOfLeftmostRests in class Subgraph

numberOfRightmostRests

public int numberOfRightmostRests()
Deprecated. Not used anymore.

Specified by:
numberOfRightmostRests in class Subgraph