org.rubato.math.yoneda
Class NameDenotator

java.lang.Object
  extended by org.rubato.math.yoneda.AbstractConnectableYoneda
      extended by org.rubato.math.yoneda.Denotator
          extended by org.rubato.math.yoneda.ListDenotator
              extended by org.rubato.math.yoneda.NameDenotator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Denotator>, java.lang.Iterable<Denotator>, Connectable, FactorDenotator, Yoneda

public final class NameDenotator
extends ListDenotator

Special list denotator for representing names of denotators and forms. Name denotators are created using the static make methods instead of explicit constructors. This is so in order to guarantee that name denotators for a given name are unique.

Author:
Gérard Milmeister
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.rubato.math.yoneda.Yoneda
COLIMIT, LIMIT, LIST, POWER, SIMPLE
 
Method Summary
 ListDenotator appendFactor(NameDenotator d)
          Name denotators are immutable.
 int compareTo(Denotator object)
           
 int compareTo(NameDenotator otherName)
          Compares two name denotators.
 NameDenotator copy()
          Returns a deep copy of this denotator.
 boolean equals(NameDenotator nd)
           
 boolean equals(java.lang.Object object)
          Checks for equality.
 Denotator getFactor(int i)
          Returns the factor in position i.
 int getFactorCount()
          Returns the number of coordinates of the denotator.
 Form getForm()
          Returns the form of the name denotator.
 Morphism getFrameCoordinate()
          Returns the frame coordinate of the denotator.
 NameDenotator getName()
          Returns the name of the denotator as a denotator.
 NameEntry getNameEntry()
          Returns the name entry in this name denotator.
 java.lang.String getNameString()
          Returns the name of the denotator converted to a string.
 int hashCode()
          Returns a hash code for this denotator.
static NameDenotator make(java.util.List<java.lang.String> names)
          Creates a name denotator composed of the given list of names.
static NameDenotator make(NameEntry name)
          Creates a name denotator from the given name entry.
static NameDenotator make(java.lang.String name)
          Creates a name denotator with the given name.
static NameDenotator make(java.lang.String op, Denotator d)
          Creates a name of the form "op(dn)", where dn is the name of the denotator d.
static NameDenotator make(java.lang.String op, Denotator[] denolist)
          Creates a name from operation and argument list.
static NameDenotator make(java.lang.String op, Denotator d1, Denotator d2)
          Creates name of the form "op(dn1,dn2)", where dn1 and dn2 are the names of the denotators d1 and d2 resp.
static NameDenotator make(java.lang.String op, Form f)
          Creates a name of the form "op(fn)".
static NameDenotator make(java.lang.String op, Form[] formlist)
          Creates a name of the form "op(fn1,..,fnm)".
static NameDenotator make(java.lang.String op, Form f1, Form f2)
          Creates a name of the form "op(fn1,fn2)".
static NameDenotator make(java.lang.String name1, java.lang.String name2)
          Creates a name denotator with the given pair of names.
 void replaceFactors(java.util.List<Denotator> denoList)
          Name denotators are immutable.
 void setFactor(int i, Denotator d)
          Name denotators are immutable.
 
Methods inherited from class org.rubato.math.yoneda.ListDenotator
_is_valid, _make_unsafe, appendFactor, appendTo, at, changeAddress, changeAddress, check, compareTo, concat, equals, fromXML, getFactors, getFrameListMorphismMap, getListForm, getListMorphismMap, getType, indexOf, isConstant, iterator, namedCopy, prepend, prependFactor, prependTo, removeFactor, toXML
 
Methods inherited from class org.rubato.math.yoneda.Denotator
atNull, clone, display, display, formEquals, get, getAddress, getCoordinate, getDependencies, getElement, getModuleMorphism, hasForm, map, nameCompareTo, nameEquals, nullAddressed, replace, resolveReferences, setName, setNameString, toString
 
Methods inherited from class org.rubato.math.yoneda.AbstractConnectableYoneda
getConnector, setConnector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static NameDenotator make(java.lang.String name)
Creates a name denotator with the given name.

Returns:
null if name is null or the empty string

make

public static NameDenotator make(java.lang.String name1,
                                 java.lang.String name2)
Creates a name denotator with the given pair of names.


make

public static NameDenotator make(java.util.List<java.lang.String> names)
Creates a name denotator composed of the given list of names.


make

public static NameDenotator make(NameEntry name)
Creates a name denotator from the given name entry.


make

public static NameDenotator make(java.lang.String op,
                                 Denotator d)
Creates a name of the form "op(dn)", where dn is the name of the denotator d.

Returns:
a new name denotator, or null if the name of dn is empty

make

public static NameDenotator make(java.lang.String op,
                                 Denotator d1,
                                 Denotator d2)
Creates name of the form "op(dn1,dn2)", where dn1 and dn2 are the names of the denotators d1 and d2 resp.

Returns:
a new name denotator, or null if one of dn1 or dn2 is empty

make

public static NameDenotator make(java.lang.String op,
                                 Denotator[] denolist)
Creates a name from operation and argument list. The name is of the form "op(dn1,...,dnm)", where dn1 to dnm are the names of the denotators from the argument list of denotators.


make

public static NameDenotator make(java.lang.String op,
                                 Form f)
Creates a name of the form "op(fn)". fn is the name of the form f.


make

public static NameDenotator make(java.lang.String op,
                                 Form f1,
                                 Form f2)
Creates a name of the form "op(fn1,fn2)". fn1 and fn2 are the names of the forms f1 and f2 resp.


make

public static NameDenotator make(java.lang.String op,
                                 Form[] formlist)
Creates a name of the form "op(fn1,..,fnm)". fn1 to fnm are the names of the forms from the argument list of forms.


getName

public NameDenotator getName()
Returns the name of the denotator as a denotator.

Overrides:
getName in class Denotator

getNameString

public java.lang.String getNameString()
Returns the name of the denotator converted to a string.

Overrides:
getNameString in class Denotator

getNameEntry

public NameEntry getNameEntry()
Returns the name entry in this name denotator.


getForm

public Form getForm()
Returns the form of the name denotator.

Overrides:
getForm in class Denotator

getFrameCoordinate

public Morphism getFrameCoordinate()
Description copied from class: Denotator
Returns the frame coordinate of the denotator.

Overrides:
getFrameCoordinate in class Denotator

getFactorCount

public int getFactorCount()
Returns the number of coordinates of the denotator.

Specified by:
getFactorCount in interface FactorDenotator
Overrides:
getFactorCount in class ListDenotator
Returns:
number of coordinates

getFactor

public Denotator getFactor(int i)
Returns the factor in position i.

Specified by:
getFactor in interface FactorDenotator
Overrides:
getFactor in class ListDenotator
Parameters:
i - denotator at position i

setFactor

public void setFactor(int i,
                      Denotator d)
Name denotators are immutable.

Specified by:
setFactor in interface FactorDenotator
Overrides:
setFactor in class ListDenotator

appendFactor

public ListDenotator appendFactor(NameDenotator d)
Name denotators are immutable.


replaceFactors

public void replaceFactors(java.util.List<Denotator> denoList)
Name denotators are immutable.

Overrides:
replaceFactors in class ListDenotator
Parameters:
denoList - the list of factor denotators

compareTo

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

compareTo

public int compareTo(NameDenotator otherName)
Compares two name denotators.


equals

public boolean equals(java.lang.Object object)
Checks for equality.

Overrides:
equals in class ListDenotator

equals

public boolean equals(NameDenotator nd)

copy

public NameDenotator copy()
Description copied from class: Denotator
Returns a deep copy of this denotator. The copy is given the same name as the original.

Overrides:
copy in class ListDenotator

hashCode

public int hashCode()
Description copied from class: Denotator
Returns a hash code for this denotator.

Overrides:
hashCode in class Denotator