org.rubato.math.yoneda
Class LimitForm

java.lang.Object
  extended by org.rubato.math.yoneda.AbstractConnectableYoneda
      extended by org.rubato.math.yoneda.Form
          extended by org.rubato.math.yoneda.LimitForm
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Form>, Connectable, Yoneda

public final class LimitForm
extends Form

Limit form class.

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
LimitForm(NameDenotator name, Diagram diagram)
          Builds a limit identity form using a diagram.
LimitForm(NameDenotator name, java.util.List<Form> forms)
          Builds a limit identity form using a list of forms.
LimitForm(NameDenotator name, java.util.List<Form> forms, java.util.List<java.lang.String> labels)
          Builds a limit identity form using a list of forms.
LimitForm(NameDenotator name, Morphism identifier)
          Generic form constructor.
 
Method Summary
 Denotator createDefaultDenotator()
          Returns a default denotator of this limit form.
 Denotator createDefaultDenotator(Module address)
          Returns a default denotator of this limit form with the given address.
 boolean equals(LimitForm f)
           
 boolean equals(java.lang.Object object)
          Returns true iff this form is equal to the specified object.
static LimitForm fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 boolean fullEquals(LimitForm f)
           
 boolean fullEquals(LimitForm f, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)
           
 Form getForm(int i)
          Returns a coordinate form.
 Form getForm(java.lang.String label)
          Returns a coordinate form.
 int getFormCount()
          Returns the number of coordinate forms.
 FormDiagram getFormDiagram()
           
 int getType()
          Returns the type of the form.
 boolean hasLabels()
          Returns true iff this form has labels.
 java.lang.String indexToLabel(int i)
          Returns the label corresponding to the given index i.
 int labelToIndex(java.lang.String label)
          Returns the index corresponding to the given label.
 void setLabels(java.util.List<java.lang.String> labels)
          Sets the labels for the factors of the form.
 java.lang.String toString()
          Returns a string representation of this form.
 void toXML(XMLWriter writer)
           
 
Methods inherited from class org.rubato.math.yoneda.Form
_register, clone, compareTo, display, display, equals, fullEquals, fullEquals, getDependencies, getDimension, getDimension, getForms, getIdentifier, getName, getNameString, getTypeString, hashCode, isRegistered, resolveReferences, setIdentifier, setName, setName, stringToType, typeToString
 
Methods inherited from class org.rubato.math.yoneda.AbstractConnectableYoneda
getConnector, setConnector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LimitForm

public LimitForm(NameDenotator name,
                 Morphism identifier)
Generic form constructor.


LimitForm

public LimitForm(NameDenotator name,
                 java.util.List<Form> forms)
Builds a limit identity form using a list of forms.


LimitForm

public LimitForm(NameDenotator name,
                 java.util.List<Form> forms,
                 java.util.List<java.lang.String> labels)
Builds a limit identity form using a list of forms.


LimitForm

public LimitForm(NameDenotator name,
                 Diagram diagram)
Builds a limit identity form using a diagram.

Method Detail

getType

public int getType()
Description copied from class: Form
Returns the type of the form.

Specified by:
getType in class Form

equals

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

Specified by:
equals in class Form

equals

public boolean equals(LimitForm f)

fullEquals

public boolean fullEquals(LimitForm f)

fullEquals

public boolean fullEquals(LimitForm f,
                          java.util.IdentityHashMap<java.lang.Object,java.lang.Object> s)

getFormCount

public int getFormCount()
Returns the number of coordinate forms.

Specified by:
getFormCount in class Form

getForm

public Form getForm(int i)
Returns a coordinate form.

Specified by:
getForm in class Form
Parameters:
i - the coordinate position
Returns:
the form at coordinate position i

getForm

public Form getForm(java.lang.String label)
             throws RubatoException
Returns a coordinate form.

Parameters:
label - the name of the coordinate form
Returns:
the form at the coordinate with the given label
Throws:
RubatoException

getFormDiagram

public FormDiagram getFormDiagram()

setLabels

public void setLabels(java.util.List<java.lang.String> labels)
Sets the labels for the factors of the form. Labels are assigned in the order they occur in the list labels.


labelToIndex

public int labelToIndex(java.lang.String label)
Returns the index corresponding to the given label.

Returns:
the index, or -1 if the label does not exist

indexToLabel

public java.lang.String indexToLabel(int i)
Returns the label corresponding to the given index i.


hasLabels

public boolean hasLabels()
Returns true iff this form has labels.


toXML

public void toXML(XMLWriter writer)
Specified by:
toXML in class Form

fromXML

public static LimitForm fromXML(XMLReader reader,
                                org.w3c.dom.Element element)
Reads XML representation from reader starting with element.

Returns:
a limit form or null if parsing failed

createDefaultDenotator

public Denotator createDefaultDenotator()
Returns a default denotator of this limit form.

Specified by:
createDefaultDenotator in class Form

createDefaultDenotator

public Denotator createDefaultDenotator(Module address)
Returns a default denotator of this limit form with the given address.

Specified by:
createDefaultDenotator in class Form

toString

public java.lang.String toString()
Description copied from class: Form
Returns a string representation of this form. This string is not parseable and does not contain all information. It is only meant for information purposes.

Specified by:
toString in class Form