org.rubato.math.yoneda
Class MathDiagram

java.lang.Object
  extended by org.rubato.math.yoneda.Diagram
      extended by org.rubato.math.yoneda.MathDiagram
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Yoneda, XMLInputOutput<Diagram>

public class MathDiagram
extends Diagram

Math diagram class (vertexes are morphisms).

Author:
Gérard Milmeister, Stefan Müller, Stefan Göller
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.rubato.math.yoneda.Yoneda
COLIMIT, LIMIT, LIST, POWER, SIMPLE
 
Constructor Summary
MathDiagram(java.util.List<Morphism> vertexes)
          Creates a diagram with a list of vertexes.
MathDiagram(java.util.List<Morphism> vertexes, java.util.List<java.util.ArrayList<Morphism>> arrows)
          Creates a diagram with a list of vertexes and list of arrows.
MathDiagram(Morphism vertex)
          Creates a diagram with a single vertex.
 
Method Summary
 java.lang.Object clone()
          Clone object.
 int compareTo(Yoneda object)
           
 void deleteArrow(int i, int j, int n)
          Deletes the n-th arrow from vertex i to vertex j.
 void deleteArrows(int i, int j)
          Deletes all arrows from vertex i to vertex j.
 void deleteVertex(int i)
          Delete the vertex at position i.
 void deleteVertexes()
          Deletes all vertexes in this diagram.
 Diagram fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 boolean fullEquals(Diagram d, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
           
 Morphism getArrow(int i, int j, int n)
          Returns the n-th arrow from vertex i to vertex j.
 int getArrowCount()
          Returns the number of arrows in the diagram.
 int getArrowCount(int i, int j)
          Returns the number of arrows from vertex i to vertex j.
 java.util.LinkedList<Denotator> getDenotatorDependencies(java.util.LinkedList<Denotator> list)
           
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 java.util.LinkedList<Form> getFormDependencies(java.util.LinkedList<Form> list)
           
 Yoneda getVertex(int i)
          Returns the vertex at position i.
 int getVertexCount()
          Returns the number of vertexes.
 int hashCode()
          Returns a hash code for this diagram.
 void insertArrow(int i, int j, int n, Morphism morphism)
          Inserts the arrow morphism from i to j at n.
 void insertVertex(int i, Morphism morphism)
          Inserts the vertex morphism at position i.
 void insertVertex(int i, Yoneda yoneda)
           
 void setVertex(int i, Morphism morphism)
          Sets the vertex at position i to morphism.
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class org.rubato.math.yoneda.Diagram
appendArrow, equals
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathDiagram

public MathDiagram(Morphism vertex)
Creates a diagram with a single vertex.


MathDiagram

public MathDiagram(java.util.List<Morphism> vertexes)
Creates a diagram with a list of vertexes.


MathDiagram

public MathDiagram(java.util.List<Morphism> vertexes,
                   java.util.List<java.util.ArrayList<Morphism>> arrows)
Creates a diagram with a list of vertexes and list of arrows.

Method Detail

getVertex

public Yoneda getVertex(int i)
Returns the vertex at position i.

Specified by:
getVertex in class Diagram

getVertexCount

public final int getVertexCount()
Returns the number of vertexes.

Specified by:
getVertexCount in class Diagram

setVertex

public void setVertex(int i,
                      Morphism morphism)
Sets the vertex at position i to morphism.


insertVertex

public void insertVertex(int i,
                         Morphism morphism)
Inserts the vertex morphism at position i.


insertVertex

public void insertVertex(int i,
                         Yoneda yoneda)

deleteVertex

public final void deleteVertex(int i)
Delete the vertex at position i.

Specified by:
deleteVertex in class Diagram

getArrow

public final Morphism getArrow(int i,
                               int j,
                               int n)
Returns the n-th arrow from vertex i to vertex j.

Specified by:
getArrow in class Diagram

getArrowCount

public final int getArrowCount(int i,
                               int j)
Returns the number of arrows from vertex i to vertex j.

Specified by:
getArrowCount in class Diagram

getArrowCount

public final int getArrowCount()
Returns the number of arrows in the diagram.


insertArrow

public final void insertArrow(int i,
                              int j,
                              int n,
                              Morphism morphism)
Inserts the arrow morphism from i to j at n.

Specified by:
insertArrow in class Diagram

deleteArrow

public final void deleteArrow(int i,
                              int j,
                              int n)
Deletes the n-th arrow from vertex i to vertex j.

Specified by:
deleteArrow in class Diagram

deleteVertexes

public final void deleteVertexes()
Description copied from class: Diagram
Deletes all vertexes in this diagram.

Overrides:
deleteVertexes in class Diagram

deleteArrows

public final void deleteArrows(int i,
                               int j)
Description copied from class: Diagram
Deletes all arrows from vertex i to vertex j.

Overrides:
deleteArrows in class Diagram

clone

public java.lang.Object clone()
Clone object. Operation just performs a shallow copy!

Specified by:
clone in interface Yoneda
Specified by:
clone in class Diagram

compareTo

public int compareTo(Yoneda object)
Specified by:
compareTo in class Diagram

hashCode

public int hashCode()
Description copied from class: Diagram
Returns a hash code for this diagram.

Specified by:
hashCode in class Diagram

fullEquals

public boolean fullEquals(Diagram d,
                          java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
Specified by:
fullEquals in class Diagram

getFormDependencies

public java.util.LinkedList<Form> getFormDependencies(java.util.LinkedList<Form> list)
Specified by:
getFormDependencies in class Diagram

getDenotatorDependencies

public java.util.LinkedList<Denotator> getDenotatorDependencies(java.util.LinkedList<Denotator> list)
Specified by:
getDenotatorDependencies in class Diagram

toXML

public void toXML(XMLWriter writer)
Description copied from interface: XMLInputOutput
Outputs XML representation to writer.


fromXML

public Diagram fromXML(XMLReader reader,
                       org.w3c.dom.Element element)
Description copied from interface: XMLInputOutput
Reads XML representation from reader starting with element.

Returns:
an object of type T or null if parsing failed

getElementTypeName

public java.lang.String getElementTypeName()
Description copied from interface: XMLInputOutput
Returns the value of the type attribute for this class.