org.rubato.math.yoneda
Class ModuleMorphismMap

java.lang.Object
  extended by org.rubato.math.yoneda.ModuleMorphismMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<MorphismMap>, MorphismMap, XMLInputOutput<MorphismMap>
Direct Known Subclasses:
ConstantModuleMorphismMap

public class ModuleMorphismMap
extends java.lang.Object
implements MorphismMap

Morphism map containing a module morphism (for type simple). Domain and codomain are modules.

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

Method Summary
 MorphismMap at(ModuleElement element)
          Creates a constant morphism from this morphism by evaluating it at the specified element.
 MorphismMap changeAddress(Module address)
          Makes an address change.
 MorphismMap changeAddress(ModuleMorphism morphism)
          Makes an address change using a module morphism.
 ModuleMorphismMap changeDomain(Module newDomain)
          Returns a module morphism map with the given new domain.
 ModuleMorphismMap changeDomain(ModuleMorphism morphism)
          Compose morphism with the morphism contained in this ModuleMorphismMap.
 java.lang.Object clone()
          Returns a copy of this module morphism map.
 int compareTo(MorphismMap object)
           
 ModuleMorphismMap copy()
          Returns a copy of this module morphism map.
 ModuleMorphismMap difference(ModuleMorphismMap map)
          Returns the difference of this map with the given map.
 boolean equals(java.lang.Object object)
           
 MorphismMap fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 boolean fullEquals(MorphismMap map, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
           
 Module getCodomain()
          Returns the codomain of the map.
 java.util.LinkedList<Denotator> getDenotatorDependencies(java.util.LinkedList<Denotator> list)
           
 Module getDomain()
          Returns the domain of the map.
 ModuleElement getElement()
          Returns the element resulting from applying the morphism to zero.
 ModuleElement getElement(int[] path, int curpos)
           
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 java.util.LinkedList<Form> getFormDependencies(java.util.LinkedList<Form> list)
           
 ModuleMorphism getMorphism()
          Returns the module morphism.
static XMLInputOutput<MorphismMap> getXMLInputOutput()
           
 int hashCode()
          Returns a hash code of this module morphism map.
 boolean isConstant()
           
static ModuleMorphismMap make(ModuleMorphism morphism)
           
 ModuleElement map(ModuleElement x)
          Maps the specified module element using the module morphism.
 ModuleMorphismMap map(ModuleMorphism morphism)
          Composes the morphism contained in this map with the given morphism.
 boolean resolveReferences(RubatoDictionary reader, java.util.IdentityHashMap<?,?> history)
          Resolves the references resulting from parsing.
 ModuleMorphismMap sum(ModuleMorphismMap map)
          Returns the sum of this map with the given map.
 java.lang.String toString()
           
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static ModuleMorphismMap make(ModuleMorphism morphism)

getElement

public ModuleElement getElement()
Returns the element resulting from applying the morphism to zero.


getMorphism

public ModuleMorphism getMorphism()
Returns the module morphism.


getDomain

public Module getDomain()
Returns the domain of the map.


getCodomain

public Module getCodomain()
Returns the codomain of the map.


compareTo

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

equals

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

fullEquals

public boolean fullEquals(MorphismMap map,
                          java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
Specified by:
fullEquals in interface MorphismMap

map

public ModuleElement map(ModuleElement x)
                  throws MappingException
Maps the specified module element using the module morphism.

Throws:
MappingException

getElement

public ModuleElement getElement(int[] path,
                                int curpos)

at

public MorphismMap at(ModuleElement element)
               throws MappingException
Creates a constant morphism from this morphism by evaluating it at the specified element.

Specified by:
at in interface MorphismMap
Parameters:
element - evaluate at this element
Returns:
a ConstantModuleMorphismMap
Throws:
MappingException - if evaluation fails

changeDomain

public ModuleMorphismMap changeDomain(Module newDomain)
Returns a module morphism map with the given new domain.

Returns:
null if a new module morphism map could not be created

changeDomain

public ModuleMorphismMap changeDomain(ModuleMorphism morphism)
Compose morphism with the morphism contained in this ModuleMorphismMap.

Returns:
a new ModuleMorphismMap or null if composition failed

changeAddress

public MorphismMap changeAddress(Module address)
Description copied from interface: MorphismMap
Makes an address change.

Specified by:
changeAddress in interface MorphismMap
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 MorphismMap changeAddress(ModuleMorphism morphism)
Description copied from interface: MorphismMap
Makes an address change using a module morphism.

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

map

public ModuleMorphismMap map(ModuleMorphism morphism)
                      throws RubatoException
Composes the morphism contained in this map with the given morphism. The resulting morphism is f(x) = this.morphism(morphism(x)).

Throws:
RubatoException

sum

public ModuleMorphismMap sum(ModuleMorphismMap map)
Returns the sum of this map with the given map.

Returns:
null if the sum fails

difference

public ModuleMorphismMap difference(ModuleMorphismMap map)
Returns the difference of this map with the given map.

Returns:
null if the difference fails

toXML

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

Specified by:
toXML in interface XMLInputOutput<MorphismMap>

fromXML

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

Specified by:
fromXML in interface XMLInputOutput<MorphismMap>
Returns:
an object of type T or null if parsing failed

getXMLInputOutput

public static XMLInputOutput<MorphismMap> getXMLInputOutput()

getElementTypeName

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

Specified by:
getElementTypeName in interface XMLInputOutput<MorphismMap>

getFormDependencies

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

getDenotatorDependencies

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

resolveReferences

public boolean resolveReferences(RubatoDictionary reader,
                                 java.util.IdentityHashMap<?,?> history)
Resolves the references resulting from parsing.

Specified by:
resolveReferences in interface MorphismMap
Returns:
true iff all references have been resolved.

isConstant

public boolean isConstant()

clone

public java.lang.Object clone()
Returns a copy of this module morphism map.

Specified by:
clone in interface MorphismMap
Overrides:
clone in class java.lang.Object

copy

public ModuleMorphismMap copy()
Returns a copy of this module morphism map.

Specified by:
copy in interface MorphismMap

toString

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

hashCode

public int hashCode()
Returns a hash code of this module morphism map.

Specified by:
hashCode in interface MorphismMap
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode of this morphism map