org.rubato.rubettes.util
Class DenotatorPath

java.lang.Object
  extended by org.rubato.rubettes.util.DenotatorPath
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>

public class DenotatorPath
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

Just interesting for comparing paths denoting coordinates of the same denotator, i.e. same size and only last index deferring.

Author:
flo

Field Summary
static java.lang.String DENOTATOR_PATH_TAG
           
 
Constructor Summary
DenotatorPath(Form baseForm)
           
DenotatorPath(Form baseForm, int[] path)
           
DenotatorPath(Form baseForm, java.util.List<java.lang.Integer> path)
           
DenotatorPath(XMLReader reader, org.w3c.dom.Element element)
           
 
Method Summary
 DenotatorPath append(DenotatorPath appendix)
           
 DenotatorPath changeBeginning(DenotatorPath model, int beginningLength)
           
 DenotatorPath clone()
           
 int compareTo(java.lang.Object object)
          Shorter paths and there the paths having smaller indices are smaller.
 boolean equals(java.lang.Object object)
           
 boolean equalsExceptForPowersetIndices(DenotatorPath path)
           
 DenotatorPath getAnchorPath()
           
 java.util.List<DenotatorPath> getAnchorPaths()
           
static java.util.List<DenotatorPath> getAnchorPaths(java.util.List<DenotatorPath> denotatorPaths)
           
 DenotatorPath getAnchorPowersetPath()
           
 Form getBaseForm()
           
 DenotatorPath getChildPath(int childIndex)
           
 DenotatorPath getDenotatorSubpath()
           
 DenotatorPath getDescendantPathAccordingTo(DenotatorPath modelPath)
           
 DenotatorPath getElementSubpath()
           
 Form getEndForm()
           
 int getFirstIndex()
           
 DenotatorPath getFirstPowersetPath()
           
static java.util.List<DenotatorPath> getGrandAnchorPowersetPaths(java.util.List<DenotatorPath> denotatorPaths)
           
 int getLastIndex()
           
 Module getModule()
           
 int getObjectIndex()
           
 java.util.List<DenotatorPath> getParentColimitPaths()
           
 DenotatorPath getParentPath()
           
static int[] getPowersetIndices(java.util.List<DenotatorPath> paths)
          TODO: this will have to get all the powerset indices for the given paths!!!!!!!! OHOooH
 DenotatorPath getPowersetPath(int powersetIndex)
           
 DenotatorPath getPowersetPath(int satelliteLevel, Form satelliteForm)
           
 DenotatorPath getSatellitePath(int index, int powersetIndex)
           
 DenotatorPath getTopPath()
           
 boolean inConflictingColimitPositions(DenotatorPath path)
           
 boolean isDirectSatelliteOf(DenotatorPath path)
           
 boolean isElementPath()
           
 boolean isPartOfSameObjectAs(DenotatorPath path)
           
 boolean isSatelliteOf(DenotatorPath path)
           
 DenotatorPath replaceLast(int index)
           
 DenotatorPath setIndex(int index, int value)
           
 int size()
           
 DenotatorPath subPath(int fromIndex)
           
 DenotatorPath subPath(int fromIndex, int toIndex)
           
 int[] toIntArray()
          Returns an array conversion of a List path
 java.lang.String toString()
           
 void toXML(XMLWriter writer)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DENOTATOR_PATH_TAG

public static final java.lang.String DENOTATOR_PATH_TAG
See Also:
Constant Field Values
Constructor Detail

DenotatorPath

public DenotatorPath(Form baseForm)

DenotatorPath

public DenotatorPath(Form baseForm,
                     int[] path)

DenotatorPath

public DenotatorPath(Form baseForm,
                     java.util.List<java.lang.Integer> path)

DenotatorPath

public DenotatorPath(XMLReader reader,
                     org.w3c.dom.Element element)
Method Detail

size

public int size()

isElementPath

public boolean isElementPath()

getDenotatorSubpath

public DenotatorPath getDenotatorSubpath()

getElementSubpath

public DenotatorPath getElementSubpath()

inConflictingColimitPositions

public boolean inConflictingColimitPositions(DenotatorPath path)

clone

public DenotatorPath clone()
Overrides:
clone in class java.lang.Object

changeBeginning

public DenotatorPath changeBeginning(DenotatorPath model,
                                     int beginningLength)
Returns:
a copy of this path, the beginning part of the given length replaced with the given model

replaceLast

public DenotatorPath replaceLast(int index)

subPath

public DenotatorPath subPath(int fromIndex)

subPath

public DenotatorPath subPath(int fromIndex,
                             int toIndex)

append

public DenotatorPath append(DenotatorPath appendix)

getDescendantPathAccordingTo

public DenotatorPath getDescendantPathAccordingTo(DenotatorPath modelPath)
Returns:
a descendant path of this path that ends with whatever modelPath has that this does not can be used to create specific powerset paths from an abstract one

compareTo

public int compareTo(java.lang.Object object)
Shorter paths and there the paths having smaller indices are smaller.

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

equalsExceptForPowersetIndices

public boolean equalsExceptForPowersetIndices(DenotatorPath path)

toIntArray

public int[] toIntArray()
Returns an array conversion of a List path


setIndex

public DenotatorPath setIndex(int index,
                              int value)

getFirstIndex

public int getFirstIndex()

getLastIndex

public int getLastIndex()

getChildPath

public DenotatorPath getChildPath(int childIndex)
Parameters:
childIndex -
Returns:
the path of the childIndex-th child of this path, regardless wether it exists or not

getParentPath

public DenotatorPath getParentPath()
Returns:
the path of the denotator this object is contained in

getSatellitePath

public DenotatorPath getSatellitePath(int index,
                                      int powersetIndex)

getAnchorPath

public DenotatorPath getAnchorPath()
Returns:
the top path of the connected object this object is a satellite of. null if there is none or if it is the topmost object

getAnchorPaths

public java.util.List<DenotatorPath> getAnchorPaths()
Returns:
a list of the paths of all anchor notes through the hierarchy starting with the direct anchor

getAnchorPowersetPath

public DenotatorPath getAnchorPowersetPath()
Returns:
the path of the powerset this connected object is in

getObjectIndex

public int getObjectIndex()
Returns:
the index of this connected object in the powerset it is in

getParentColimitPaths

public java.util.List<DenotatorPath> getParentColimitPaths()

getTopPath

public DenotatorPath getTopPath()
Returns:
the top path of this connected object, meaning the path at which it appears in a powerset above

isDirectSatelliteOf

public boolean isDirectSatelliteOf(DenotatorPath path)
Returns:
true if this path is a direct satellite of the given path, i.e. contained in one of its powersets

isSatelliteOf

public boolean isSatelliteOf(DenotatorPath path)
Returns:
true if this path is a direct or indirect satellite of the given path, i.e. maybe connected by intermediate satellite levels.

isPartOfSameObjectAs

public boolean isPartOfSameObjectAs(DenotatorPath path)

getAnchorPaths

public static java.util.List<DenotatorPath> getAnchorPaths(java.util.List<DenotatorPath> denotatorPaths)

getGrandAnchorPowersetPaths

public static java.util.List<DenotatorPath> getGrandAnchorPowersetPaths(java.util.List<DenotatorPath> denotatorPaths)

getPowersetIndices

public static int[] getPowersetIndices(java.util.List<DenotatorPath> paths)
TODO: this will have to get all the powerset indices for the given paths!!!!!!!! OHOooH


getBaseForm

public Form getBaseForm()

getEndForm

public Form getEndForm()
Returns:
the form that the path ends with, even if it goes on into module elements

getModule

public Module getModule()

getFirstPowersetPath

public DenotatorPath getFirstPowersetPath()

getPowersetPath

public DenotatorPath getPowersetPath(int powersetIndex)
Returns:
the path of the powersetIndex-th powerset found, null if there are none within the given search depth or less than reached by the powersetIndex. search does not continue through powersets. if the given form itself is a powerset and powersetIndex is 0 it is returned instantly.

getPowersetPath

public DenotatorPath getPowersetPath(int satelliteLevel,
                                     Form satelliteForm)

toString

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

toXML

public void toXML(XMLWriter writer)