org.rubato.math.module
Class RestrictedModule

java.lang.Object
  extended by org.rubato.math.module.RestrictedModule
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Module>, Module, XMLInputOutput<Module>

public class RestrictedModule
extends java.lang.Object
implements Module

Modules with restricted ring of scalars. Instances are created using the static make(ModuleMorphism,Module) method.

Author:
Gérard Milmeister
See Also:
Serialized Form

Method Summary
 ModuleElement cast(ModuleElement element)
          Casts element to an element in this module if possible.
 int compareTo(Module object)
          Compares this module with object.
 ModuleElement createElement(java.util.List<ModuleElement> elements)
          Creates an element in this module from a list of module elements.
 boolean equals(java.lang.Object object)
          Returns true iff this module is equals to object.
 Module fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 Module getComponentModule(int i)
          Returns the i-th component module.
 int getDimension()
          Returns the dimension of this module.
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 ModuleMorphism getIdentityMorphism()
          Returns the identity morphism in this module.
 Module getNullModule()
          Returns the null-module corresponding to this module.
 ModuleMorphism getRestrictingMorphism()
          Returns the morphism responsible for the restriction.
 Ring getRing()
          Returns the underlying ring of this module.
 ModuleMorphism getTranslation(ModuleElement element)
          Returns a morphism that translates by element.
 Module getUnrestrictedModule()
          Returns the unrestricted module at the origin of this restricted module.
static XMLInputOutput<Module> getXMLInputOutput()
           
 ModuleElement getZero()
          Returns the zero element in this module.
 boolean hasElement(ModuleElement element)
          Returns true iff element is an element of this module.
 boolean isNullModule()
          Returns true iff this is a null-module.
 boolean isRing()
          Returns true iff this module is a ring.
static RestrictedModule make(ModuleMorphism morphism, Module module)
          Creates a new scalar-restricted module based on module where the restriction is effectuated through morphism.
static RestrictedModule make(Ring ring, Module module)
          Creates a new scalar-restricted module based on module where the restriction is effectuated through embedding the given ring in the base ring of module.
 ModuleElement parseString(java.lang.String string)
          Creates an element in this module from a string representation.
 java.lang.String toString()
          Returns a human readable string representation of this module.
 java.lang.String toVisualString()
          Returns a human readable string representation of this module.
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rubato.math.module.Module
hashCode
 

Method Detail

make

public static RestrictedModule make(ModuleMorphism morphism,
                                    Module module)
                             throws DomainException
Creates a new scalar-restricted module based on module where the restriction is effectuated through morphism. The codomain of morphism must be equal to the base ring of module.

Throws:
DomainException - if morphism does not have the correct codomain

make

public static RestrictedModule make(Ring ring,
                                    Module module)
                             throws DomainException
Creates a new scalar-restricted module based on module where the restriction is effectuated through embedding the given ring in the base ring of module.

Throws:
DomainException - if the embedding is not possible

getZero

public ModuleElement getZero()
Description copied from interface: Module
Returns the zero element in this module.

Specified by:
getZero in interface Module

getIdentityMorphism

public ModuleMorphism getIdentityMorphism()
Description copied from interface: Module
Returns the identity morphism in this module.

Specified by:
getIdentityMorphism in interface Module

getDimension

public int getDimension()
Description copied from interface: Module
Returns the dimension of this module.

Specified by:
getDimension in interface Module

getNullModule

public Module getNullModule()
Description copied from interface: Module
Returns the null-module corresponding to this module.

Specified by:
getNullModule in interface Module

isNullModule

public boolean isNullModule()
Description copied from interface: Module
Returns true iff this is a null-module.

Specified by:
isNullModule in interface Module

isRing

public boolean isRing()
Description copied from interface: Module
Returns true iff this module is a ring.

Specified by:
isRing in interface Module

getRing

public Ring getRing()
Description copied from interface: Module
Returns the underlying ring of this module.

Specified by:
getRing in interface Module

getComponentModule

public Module getComponentModule(int i)
Description copied from interface: Module
Returns the i-th component module.

Specified by:
getComponentModule in interface Module

getUnrestrictedModule

public Module getUnrestrictedModule()
Returns the unrestricted module at the origin of this restricted module.


getRestrictingMorphism

public ModuleMorphism getRestrictingMorphism()
Returns the morphism responsible for the restriction.


hasElement

public boolean hasElement(ModuleElement element)
Description copied from interface: Module
Returns true iff element is an element of this module.

Specified by:
hasElement in interface Module

getTranslation

public ModuleMorphism getTranslation(ModuleElement element)
Description copied from interface: Module
Returns a morphism that translates by element.

Specified by:
getTranslation in interface Module

cast

public ModuleElement cast(ModuleElement element)
Description copied from interface: Module
Casts element to an element in this module if possible.

Specified by:
cast in interface Module
Returns:
null if cast is not possible

createElement

public ModuleElement createElement(java.util.List<ModuleElement> elements)
Description copied from interface: Module
Creates an element in this module from a list of module elements.

Specified by:
createElement in interface Module
Returns:
null if no element in this module can be created from the arguments.

parseString

public ModuleElement parseString(java.lang.String string)
Description copied from interface: Module
Creates an element in this module from a string representation.

Specified by:
parseString in interface Module
Returns:
null if the string is in the wrong format

equals

public boolean equals(java.lang.Object object)
Description copied from interface: Module
Returns true iff this module is equals to object.

Specified by:
equals in interface Module
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(Module object)
Description copied from interface: Module
Compares this module with object.

Specified by:
compareTo in interface java.lang.Comparable<Module>
Specified by:
compareTo in interface Module

toString

public java.lang.String toString()
Description copied from interface: Module
Returns a human readable string representation of this module. The representation is not meant to be parseable.

Specified by:
toString in interface Module
Overrides:
toString in class java.lang.Object

toVisualString

public java.lang.String toVisualString()
Description copied from interface: Module
Returns a human readable string representation of this module. The representation is not meant to be parseable. The string should be a short representation, possibly using Unicode characters.

Specified by:
toVisualString in interface Module

toXML

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

Specified by:
toXML in interface XMLInputOutput<Module>

fromXML

public Module 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<Module>
Returns:
an object of type T or null if parsing failed

getXMLInputOutput

public static XMLInputOutput<Module> 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<Module>