org.rubato.math.yoneda
Class CompoundMorphism

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

public final class CompoundMorphism
extends Morphism

General morphism. A morphism is characterized by its domain, codomain and map. Domain and codomain are objects represented through identity 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
CompoundMorphism(IdentityMorphism domain, IdentityMorphism codomain, MorphismMap map)
          Creates a morphism between two general objects.
CompoundMorphism(Module domain, IdentityMorphism codomain, MorphismMap map)
          Creates a morphism with a module domain and an arbitrary codomain.
CompoundMorphism(Module domain, Module codomain, MorphismMap map)
          Creates a morphism with module domain and codomain.
 
Method Summary
 Morphism at(ModuleElement element)
          Evaluates this morphism at address element.
 Morphism changeAddress(Module address)
          Makes an address change.
 Morphism changeAddress(ModuleMorphism morphism)
          Makes an address change using a module morphism.
 int compareTo(Morphism object)
           
 CompoundMorphism copy()
          Returns a deep copy of this morphism.
 boolean equals(java.lang.Object object)
          Returns true iff this morphism is equal to the specified object.
 Morphism fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 boolean fullEquals(Morphism m, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
           
 IdentityMorphism getCodomain()
          Returns the codomain identity morphism (object) of this morphism.
 Diagram getCodomainDiagram()
          Returns the codomain diagram of this morphism.
 Module getCodomainModule()
          Returns the codomain module of this morphism.
 int getCodomainType()
          Returns the codomain denotator type of this morphism.
 java.util.LinkedList<Denotator> getDenotatorDependencies(java.util.LinkedList<Denotator> list)
          Adds the denotator dependencies of this morphism to list.
 IdentityMorphism getDomain()
          Returns the domain identity morphism (object) of this morphism.
 Diagram getDomainDiagram()
          Returns the domain diagram of this morphism.
 Module getDomainModule()
          Returns the domain module of this morphism.
 int getDomainType()
          Returns the domain denotator type of this morphism.
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 java.util.LinkedList<Form> getFormDependencies(java.util.LinkedList<Form> list)
          Adds the form dependencies of this morphism to list.
 MorphismMap getMap()
          Returns the implementation of this morphism.
 int hashCode()
          Returns a hash code for this morphism.
 boolean resolveReferences(RubatoDictionary dict, java.util.IdentityHashMap<?,?> history)
          Resolve the references in this morphism resulting from parsing.
 void setMap(MorphismMap map)
          Sets the implementation of this morphism.
 java.lang.String toString()
           
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class org.rubato.math.yoneda.Morphism
clone, isIdentity, isRepresentable
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompoundMorphism

public CompoundMorphism(IdentityMorphism domain,
                        IdentityMorphism codomain,
                        MorphismMap map)
Creates a morphism between two general objects. For morphisms between modules, see other constructors below.


CompoundMorphism

public CompoundMorphism(Module domain,
                        IdentityMorphism codomain,
                        MorphismMap map)
Creates a morphism with a module domain and an arbitrary codomain.


CompoundMorphism

public CompoundMorphism(Module domain,
                        Module codomain,
                        MorphismMap map)
Creates a morphism with module domain and codomain.

Method Detail

getDomainDiagram

public Diagram getDomainDiagram()
Description copied from class: Morphism
Returns the domain diagram of this morphism.

Specified by:
getDomainDiagram in class Morphism

getCodomainDiagram

public Diagram getCodomainDiagram()
Description copied from class: Morphism
Returns the codomain diagram of this morphism.

Specified by:
getCodomainDiagram in class Morphism

getDomainModule

public Module getDomainModule()
Description copied from class: Morphism
Returns the domain module of this morphism.

Specified by:
getDomainModule in class Morphism

getCodomainModule

public Module getCodomainModule()
Description copied from class: Morphism
Returns the codomain module of this morphism.

Specified by:
getCodomainModule in class Morphism

getDomainType

public int getDomainType()
Description copied from class: Morphism
Returns the domain denotator type of this morphism.

Specified by:
getDomainType in class Morphism

getCodomainType

public int getCodomainType()
Description copied from class: Morphism
Returns the codomain denotator type of this morphism.

Specified by:
getCodomainType in class Morphism

changeAddress

public Morphism changeAddress(Module address)
Description copied from class: Morphism
Makes an address change.

Specified by:
changeAddress in class Morphism
Parameters:
address - the new address of the denotator
Returns:
a copy of this morphism with address newAddress or null if address changed fails

changeAddress

public Morphism changeAddress(ModuleMorphism morphism)
Description copied from class: Morphism
Makes an address change using a module morphism.

Specified by:
changeAddress in class Morphism
Parameters:
morphism - the address changing morphism
Returns:
a copy of this morphism with the new address or null if address change fails

getMap

public MorphismMap getMap()
Description copied from class: Morphism
Returns the implementation of this morphism.

Specified by:
getMap in class Morphism

setMap

public void setMap(MorphismMap map)
Description copied from class: Morphism
Sets the implementation of this morphism.

Specified by:
setMap in class Morphism

at

public Morphism at(ModuleElement element)
            throws MappingException
Description copied from class: Morphism
Evaluates this morphism at address element.

Specified by:
at in class Morphism
Throws:
MappingException - if evaluation fails

copy

public CompoundMorphism copy()
Description copied from class: Morphism
Returns a deep copy of this morphism.

Specified by:
copy in class Morphism

getDomain

public IdentityMorphism getDomain()
Description copied from class: Morphism
Returns the domain identity morphism (object) of this morphism.

Specified by:
getDomain in class Morphism

getCodomain

public IdentityMorphism getCodomain()
Description copied from class: Morphism
Returns the codomain identity morphism (object) of this morphism.

Specified by:
getCodomain in class Morphism

compareTo

public int compareTo(Morphism object)
Specified by:
compareTo in interface java.lang.Comparable<Morphism>
Overrides:
compareTo in class Morphism

equals

public boolean equals(java.lang.Object object)
Description copied from class: Morphism
Returns true iff this morphism is equal to the specified object.

Specified by:
equals in class Morphism

fullEquals

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

getFormDependencies

public java.util.LinkedList<Form> getFormDependencies(java.util.LinkedList<Form> list)
Description copied from class: Morphism
Adds the form dependencies of this morphism to list.

Specified by:
getFormDependencies in class Morphism

getDenotatorDependencies

public java.util.LinkedList<Denotator> getDenotatorDependencies(java.util.LinkedList<Denotator> list)
Description copied from class: Morphism
Adds the denotator dependencies of this morphism to list.

Specified by:
getDenotatorDependencies in class Morphism

toString

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

toXML

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


fromXML

public Morphism 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: Morphism
Returns a hash code for this morphism.

Specified by:
hashCode in class Morphism

resolveReferences

public boolean resolveReferences(RubatoDictionary dict,
                                 java.util.IdentityHashMap<?,?> history)
Description copied from class: Morphism
Resolve the references in this morphism resulting from parsing.

Returns:
true iff all references have been resolved.