Class SeqSubgraph

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

public class SeqSubgraph
extends Subgraph

A sequential subgraph represents a string of music vertices which follow immediately upon each other inside the mother graph of the sequential subgraph.


Field Summary
 
Fields inherited from class Subgraph
mothergraph
 
Fields inherited from class MusicGraph
edges, title, vertices
 
Constructor Summary
SeqSubgraph(MusicVertex mv, MotherGraph mother)
          Constructs a SeqSubgraph with only one MusicVertex in it.
SeqSubgraph(java.lang.String t, MotherGraph mother)
          Neutral constructor for subgraphing.
 
Method Summary
 java.lang.Object clone()
          Performs a shallow clone of this sequential subgraph.
 jm.music.data.Score convertToScore()
          Converts this SeqSubgraph to a Score; includes only notes in this subgraph.
 void extend(int times)
          Extends this subgraph by randomly adding to it a MusicVertex which, in the mother graph, is connected to either the sink or the source of this sequential subgraph.
 void extendLeft(int times)
          Extends this sequential subgraph to the left.
 void extendRight(int times)
          Extends this sequential subgraph to the right.
 int[][] getDistanceArrays()
          Returns arrays of the minimum and maximum distances from and to the beginning and end of the MotherGraph of all vertices in this sequential subgraph.
 int getLeftExtensibility()
          Returns how many times this Subgraph may be extended to the left.
 int getMaximalSequentialSubgraphSize()
          Simply returns the size of this subgraph, since it is already sequential, and its maximal sequential subgraph therefore has the same size.
 double getMothergraphCoverage()
          Deprecated. Not used anymore.
 MusicEdge[] getMusicEdgeArray()
          Returns the edges contained in this sequential subgraph in an array rather than the Vector 'edges' in which they are contained in the superclass MusicGraph.
 MusicVertex[] getMusicVertexArray()
          Returns the vertices contained in this sequential subgraph in an array rather than the Vector 'vertices' in which they are contained in the superclass MusicGraph.
 int[] getNameArray()
          Returns an array of the pitch spelling names of notes represented by vertices in this sequential subgraph; NB: Should only be used when diatonic data is available
 NoteInfo[] getNoteInfoArray()
          Returns the nested noteinfos.
 int[] getOctaveArray()
          Returns an array of the octaves of notes represented by vertices in this sequential subgraph; NB: Should only be used when diatonic data is available
 int[] getPitchArray()
          Returns an array of the pitch values of notes represented by vertices in this sequential subgraph.
 int[] getPitchClassArray()
          Returns an array of the pitch class values of notes represented by vertices in this sequential subgraph.
 double[] getRhythmArray()
          Returns an array of the length of notes represented by vertices in this sequential subgraph.
 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)
          Shortens this subgraph by removing either the source or the sink of this sequential subgraph and the edge that connected it to the rest of this subgraph.
 void shortenLeft(int times)
          Shortens this sequential subgraph to the left.
 void shortenRight(int times)
          Shortens this sequential subgraph to the right.
 void slide(int times)
          Slides this sequential subgraph a number of times to the left or right.
 void slideLeft(int times)
          Slides this sequential subgraph to the left.
 void slideRight(int times)
          Slides this sequential subgraph to the right.
 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

SeqSubgraph

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


SeqSubgraph

public SeqSubgraph(MusicVertex mv,
                   MotherGraph mother)
Constructs a SeqSubgraph with only one MusicVertex in it.

Method Detail

clone

public java.lang.Object clone()
Performs a shallow clone of this sequential subgraph.

Specified by:
clone in class MusicGraph

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

getMusicVertexArray

public MusicVertex[] getMusicVertexArray()
Returns the vertices contained in this sequential subgraph in an array rather than the Vector 'vertices' in which they are contained in the superclass MusicGraph.


getMusicEdgeArray

public MusicEdge[] getMusicEdgeArray()
Returns the edges contained in this sequential subgraph in an array rather than the Vector 'edges' in which they are contained in the superclass MusicGraph.


getNoteInfoArray

public NoteInfo[] getNoteInfoArray()
Returns the nested noteinfos.


getPitchArray

public int[] getPitchArray()
Returns an array of the pitch values of notes represented by vertices in this sequential subgraph.


getRhythmArray

public double[] getRhythmArray()
Returns an array of the length of notes represented by vertices in this sequential subgraph.


getPitchClassArray

public int[] getPitchClassArray()
Returns an array of the pitch class values of notes represented by vertices in this sequential subgraph.


getDistanceArrays

public int[][] getDistanceArrays()
Returns arrays of the minimum and maximum distances from and to the beginning and end of the MotherGraph of all vertices in this sequential subgraph. The first index is in the range 0<=i<=3, where 0=maxDistanceFromStart, 1=minDistanceFromStart, 2=maxDistanceFromEnd, 3=minDistanceFromEnd. The second index varies over the number of vertices in this subgraph.


getNameArray

public int[] getNameArray()
Returns an array of the pitch spelling names of notes represented by vertices in this sequential subgraph; NB: Should only be used when diatonic data is available


getOctaveArray

public int[] getOctaveArray()
Returns an array of the octaves of notes represented by vertices in this sequential subgraph; NB: Should only be used when diatonic data is available


slideLeft

public void slideLeft(int times)
               throws java.lang.Exception
Slides this sequential subgraph to the left.

java.lang.Exception

slideRight

public void slideRight(int times)
                throws java.lang.Exception
Slides this sequential subgraph to the right.

java.lang.Exception

extendLeft

public void extendLeft(int times)
                throws java.lang.Exception
Extends this sequential subgraph to the left.

java.lang.Exception

extendRight

public void extendRight(int times)
                 throws java.lang.Exception
Extends this sequential subgraph to the right.

java.lang.Exception

shortenLeft

public void shortenLeft(int times)
                 throws java.lang.Exception
Shortens this sequential subgraph to the left.

java.lang.Exception

shortenRight

public void shortenRight(int times)
                  throws java.lang.Exception
Shortens this sequential subgraph to the right.

java.lang.Exception

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

extend

public void extend(int times)
            throws java.lang.Exception
Extends this subgraph by randomly adding to it a MusicVertex which, in the mother graph, is connected to either the sink or the source of this sequential subgraph. The edge connecting them is also added.

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

shorten

public void shorten(int times)
             throws java.lang.Exception
Shortens this subgraph by removing either the source or the sink of this sequential subgraph and the edge that connected it to the rest of this subgraph.

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

slide

public void slide(int times)
           throws java.lang.Exception
Slides this sequential subgraph a number of times to the left or right.

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

convertToScore

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

Specified by:
convertToScore in class MusicGraph

getMaximalSequentialSubgraphSize

public int getMaximalSequentialSubgraphSize()
Simply returns the size of this subgraph, since it is already sequential, and its maximal sequential subgraph therefore has the same size.

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