org.rubato.math.yoneda
Class FormDiagram

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

public final class FormDiagram
extends Diagram

Diagram of forms.

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

Field Summary
static FormDiagram emptyFormDiagram
           
 
Fields inherited from interface org.rubato.math.yoneda.Yoneda
COLIMIT, LIMIT, LIST, POWER, SIMPLE
 
Constructor Summary
FormDiagram(Form form)
          Creates a diagram with the given form as its single vertex.
FormDiagram(java.util.List<Form> forms)
          Creates a diagram using the given list of forms as vertexes.
 
Method Summary
 void appendArrow(int i, int j, Morphism morphism)
          Appends an arrow from vertex i to vertex j.
 void appendForm(Form form)
           
 java.lang.Object clone()
          Returns a shallow copy of this diagram.
 int compareTo(Yoneda object)
           
 void deleteArrow(int i, int j, int n)
          Deletes the n-th arrow from vertex i to vertex j.
 void deleteForm(int i)
           
 void deleteVertex(int i)
          Deletes the vertex at position i.
 boolean equals(java.lang.Object object)
          Returns true if this diagram is equal to the specified object.
 Diagram fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 boolean fullEquals(Diagram diagram, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> history)
           
 Morphism getArrow(int i, int j, int n)
          Returns the n-th arrow from vertex i to vertex j.
 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.
 Form getForm(int i)
           
 int getFormCount()
           
 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 an arrow from vertex i to vertex j at position n.
 void insertForm(int i, Form form)
           
 boolean registerForms(Repository rep, boolean builtin)
           
 void setForm(int i, Form form)
           
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class org.rubato.math.yoneda.Diagram
deleteArrows, deleteVertexes
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emptyFormDiagram

public static FormDiagram emptyFormDiagram
Constructor Detail

FormDiagram

public FormDiagram(Form form)
Creates a diagram with the given form as its single vertex.


FormDiagram

public FormDiagram(java.util.List<Form> forms)
Creates a diagram using the given list of forms as vertexes.

Method Detail

getForm

public Form getForm(int i)

getFormCount

public int getFormCount()

setForm

public void setForm(int i,
                    Form form)

insertForm

public void insertForm(int i,
                       Form form)

appendForm

public void appendForm(Form form)

deleteForm

public void deleteForm(int i)

getVertex

public Yoneda getVertex(int i)
Description copied from class: Diagram
Returns the vertex at position i.

Specified by:
getVertex in class Diagram

deleteVertex

public void deleteVertex(int i)
Description copied from class: Diagram
Deletes the vertex at position i.

Specified by:
deleteVertex in class Diagram

getVertexCount

public int getVertexCount()
Description copied from class: Diagram
Returns the number of vertexes.

Specified by:
getVertexCount in class Diagram

getArrow

public Morphism getArrow(int i,
                         int j,
                         int n)
Description copied from class: Diagram
Returns the n-th arrow from vertex i to vertex j.

Specified by:
getArrow in class Diagram

getArrowCount

public int getArrowCount(int i,
                         int j)
Description copied from class: Diagram
Returns the number of arrows from vertex i to vertex j.

Specified by:
getArrowCount in class Diagram

insertArrow

public void insertArrow(int i,
                        int j,
                        int n,
                        Morphism morphism)
Description copied from class: Diagram
Inserts an arrow from vertex i to vertex j at position n.

Specified by:
insertArrow in class Diagram

deleteArrow

public void deleteArrow(int i,
                        int j,
                        int n)
Description copied from class: Diagram
Deletes the n-th arrow from vertex i to vertex j.

Specified by:
deleteArrow in class Diagram

appendArrow

public void appendArrow(int i,
                        int j,
                        Morphism morphism)
Description copied from class: Diagram
Appends an arrow from vertex i to vertex j.

Overrides:
appendArrow in class Diagram

compareTo

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

equals

public boolean equals(java.lang.Object object)
Description copied from class: Diagram
Returns true if this diagram is equal to the specified object.

Overrides:
equals in class Diagram

clone

public java.lang.Object clone()
Returns a shallow copy of this diagram. Forms and morphisms themselves are not cloned.

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

fullEquals

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

registerForms

public boolean registerForms(Repository rep,
                             boolean builtin)

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.


hashCode

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

Specified by:
hashCode in class Diagram