org.rubato.math.module
Class Ring

java.lang.Object
  extended by org.rubato.math.module.Ring
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Module>, FreeModule, Module, XMLInputOutput<Module>
Direct Known Subclasses:
ModularPolynomialRing, NumberRing, PolynomialRing, ProductRing, StringRing, ZnRing

public abstract class Ring
extends java.lang.Object
implements FreeModule

The abstract base class for rings. Rings always have dimension 1.

Author:
Gérard Milmeister
See Also:
RingElement, Serialized Form

Constructor Summary
Ring()
           
 
Method Summary
 int compareTo(Module object)
          Compares this module with object.
 Module getComponentModule(int i)
          A ring has just one component module: itself.
 int getDimension()
          Here, the dimension of a ring as a module is 1.
abstract  FreeModule getFreeModule(int dimension)
          Returns the corresponding free module of dimension dim.
 ModuleMorphism getInjection(int index)
          Returns a module morphism that injects a ring into the free module at the component index.
abstract  RingElement getOne()
          Returns the unit element of this ring.
 ModuleMorphism getProjection(int index)
          Returns a module morphism that projects the free module at the component index.
 Ring getRing()
          The underlying ring of a ring as a module is itself.
 ModuleMorphism getTranslation(ModuleElement element)
          Returns a morphism that translates by element.
 RingElement getUnitElement(int i)
          Returns the unit vector with 1 at position i.
abstract  RingElement getZero()
          Returns the zero element of this ring.
abstract  boolean isField()
          Returns true if this ring is a field.
 boolean isNullModule()
          Here, a ring is not a null-module.
 boolean isRing()
          Returns true if this module is a ring.
abstract  RingElement parseString(java.lang.String s)
          Creates an element in this module from a string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rubato.math.module.FreeModule
isVectorspace
 
Methods inherited from interface org.rubato.math.module.Module
cast, createElement, equals, getIdentityMorphism, getNullModule, hasElement, hashCode, toString, toVisualString
 
Methods inherited from interface org.rubato.xml.XMLInputOutput
fromXML, getElementTypeName, toXML
 

Constructor Detail

Ring

public Ring()
Method Detail

getZero

public abstract RingElement getZero()
Returns the zero element of this ring.

Specified by:
getZero in interface Module

getOne

public abstract RingElement getOne()
Returns the unit element of this ring.


getUnitElement

public RingElement getUnitElement(int i)
Returns the unit vector with 1 at position i. In the case of rings, this is simple the unit.

Specified by:
getUnitElement in interface FreeModule

getProjection

public ModuleMorphism getProjection(int index)
Description copied from interface: FreeModule
Returns a module morphism that projects the free module at the component index.

Specified by:
getProjection in interface FreeModule
Parameters:
index - the number of the component to project to, the index will be clamped between 0 and the dimension-1 of the free module

getInjection

public ModuleMorphism getInjection(int index)
Description copied from interface: FreeModule
Returns a module morphism that injects a ring into the free module at the component index.

Specified by:
getInjection in interface FreeModule
Parameters:
index - the number of the component to project to, the index will be clamped between 0 and the dimension-1 of the free module

isField

public abstract boolean isField()
Returns true if this ring is a field.


isRing

public boolean isRing()
Returns true if this module is a ring.

Specified by:
isRing in interface Module

getFreeModule

public abstract FreeModule getFreeModule(int dimension)
Returns the corresponding free module of dimension dim.


getDimension

public int getDimension()
Here, the dimension of a ring as a module is 1.

Specified by:
getDimension in interface Module

getComponentModule

public Module getComponentModule(int i)
A ring has just one component module: itself.

Specified by:
getComponentModule in interface Module

isNullModule

public boolean isNullModule()
Here, a ring is not a null-module.

Specified by:
isNullModule in interface Module

getRing

public Ring getRing()
The underlying ring of a ring as a module is itself.

Specified by:
getRing in interface Module

parseString

public abstract RingElement parseString(java.lang.String s)
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

getTranslation

public ModuleMorphism getTranslation(ModuleElement element)
Returns a morphism that translates by element.

Specified by:
getTranslation in interface Module

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