org.rubato.math.yoneda
Class ConstantModuleMorphismMap

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

public final class ConstantModuleMorphismMap
extends ModuleMorphismMap

Morphism map containing a constant module morphism.

Author:
Gérard Milmeister
See Also:
Serialized Form

Constructor Summary
ConstantModuleMorphismMap(ModuleElement element)
          Creates a constant morphism with constant element.
ConstantModuleMorphismMap(Module domain, ModuleElement element)
          Creates a constant morphism with constant element.
 
Method Summary
 MorphismMap at(ModuleElement element)
          Creates a constant morphism from this morphism by evaluating it at the specified element.
 ModuleMorphismMap changeDomain(Module newAddress)
          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.
 Module getDomain()
          Returns the domain of the map.
 ModuleElement getElement()
          Returns the element resulting from applying the morphism to zero.
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 ModuleMorphism getMorphism()
          Returns the module morphism.
static XMLInputOutput<MorphismMap> getXMLInputOutput()
           
 int hashCode()
          Returns a hash code of this module morphism map.
 boolean isConstant()
           
 ModuleElement map(ModuleElement element)
          Maps the specified module element using the module morphism.
 ModuleMorphismMap map(ModuleMorphism morphism)
          Composes the morphism contained in this map with the given morphism.
 void setElement(ModuleElement element)
           
 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 org.rubato.math.yoneda.ModuleMorphismMap
changeAddress, changeAddress, getDenotatorDependencies, getElement, getFormDependencies, make, resolveReferences
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantModuleMorphismMap

public ConstantModuleMorphismMap(ModuleElement element)
Creates a constant morphism with constant element. The codomain is domain of the element. The domain is the null module corresponding to the codomain.


ConstantModuleMorphismMap

public ConstantModuleMorphismMap(Module domain,
                                 ModuleElement element)
Creates a constant morphism with constant element. The codomain is domain of the element. The domain is the specified one.

Method Detail

getElement

public ModuleElement getElement()
Description copied from class: ModuleMorphismMap
Returns the element resulting from applying the morphism to zero.

Overrides:
getElement in class ModuleMorphismMap

getMorphism

public ModuleMorphism getMorphism()
Description copied from class: ModuleMorphismMap
Returns the module morphism.

Overrides:
getMorphism in class ModuleMorphismMap

getDomain

public Module getDomain()
Description copied from class: ModuleMorphismMap
Returns the domain of the map.

Overrides:
getDomain in class ModuleMorphismMap

getCodomain

public Module getCodomain()
Description copied from class: ModuleMorphismMap
Returns the codomain of the map.

Overrides:
getCodomain in class ModuleMorphismMap

setElement

public void setElement(ModuleElement element)

compareTo

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

equals

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

fullEquals

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

map

public ModuleElement map(ModuleElement element)
Description copied from class: ModuleMorphismMap
Maps the specified module element using the module morphism.

Overrides:
map in class ModuleMorphismMap

at

public MorphismMap at(ModuleElement element)
Description copied from class: ModuleMorphismMap
Creates a constant morphism from this morphism by evaluating it at the specified element.

Specified by:
at in interface MorphismMap
Overrides:
at in class ModuleMorphismMap
Parameters:
element - evaluate at this element
Returns:
a ConstantModuleMorphismMap

changeDomain

public ModuleMorphismMap changeDomain(ModuleMorphism morphism)
Description copied from class: ModuleMorphismMap
Compose morphism with the morphism contained in this ModuleMorphismMap.

Overrides:
changeDomain in class ModuleMorphismMap
Returns:
a new ModuleMorphismMap or null if composition failed

changeDomain

public ModuleMorphismMap changeDomain(Module newAddress)
Description copied from class: ModuleMorphismMap
Returns a module morphism map with the given new domain.

Overrides:
changeDomain in class ModuleMorphismMap
Returns:
null if a new module morphism map could not be created

map

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

Overrides:
map in class ModuleMorphismMap
Throws:
RubatoException

sum

public ModuleMorphismMap sum(ModuleMorphismMap map)
Description copied from class: ModuleMorphismMap
Returns the sum of this map with the given map.

Overrides:
sum in class ModuleMorphismMap
Returns:
null if the sum fails

difference

public ModuleMorphismMap difference(ModuleMorphismMap map)
Description copied from class: ModuleMorphismMap
Returns the difference of this map with the given map.

Overrides:
difference in class ModuleMorphismMap
Returns:
null if the difference fails

isConstant

public boolean isConstant()
Overrides:
isConstant in class ModuleMorphismMap

clone

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

Specified by:
clone in interface MorphismMap
Overrides:
clone in class ModuleMorphismMap

copy

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

Specified by:
copy in interface MorphismMap
Overrides:
copy in class ModuleMorphismMap

toString

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

toXML

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

Specified by:
toXML in interface XMLInputOutput<MorphismMap>
Overrides:
toXML in class ModuleMorphismMap

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>
Overrides:
fromXML in class ModuleMorphismMap
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>
Overrides:
getElementTypeName in class ModuleMorphismMap

hashCode

public int hashCode()
Description copied from class: ModuleMorphismMap
Returns a hash code of this module morphism map.

Specified by:
hashCode in interface MorphismMap
Overrides:
hashCode in class ModuleMorphismMap
Returns:
the hashcode of this morphism map