|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.math.module.DirectSumElement
public final class DirectSumElement
Elements with components from arbitrary modules.
DirectSumModule
,
Serialized FormMethod Summary | |
---|---|
void |
add(ModuleElement element)
Adds element to this module element. |
ModuleElement |
cast(Module module)
Tries to cast this element to an element in the given module. |
DirectSumElement |
clone()
Returns a deep copy of this module element. |
int |
compareTo(ModuleElement object)
Compares this module element with object . |
DirectSumElement |
difference(ModuleElement element)
Returns the difference of this module element and element . |
boolean |
equals(java.lang.Object object)
Returns true iff this element is equal to object . |
java.util.List<ModuleElement> |
flatten()
|
double[] |
fold(ModuleElement[] elements)
Fold elements assuming they are of this same type. |
double[] |
foldOne(ModuleElement[] elements,
int index)
|
ModuleElement |
fromXML(XMLReader reader,
org.w3c.dom.Element element)
Reads XML representation from reader starting with element . |
ModuleElement |
getComponent(int i)
Returns the i -th component element. |
java.lang.String |
getElementTypeName()
Returns the value of the type attribute for this class. |
int |
getLength()
Returns the length of the element. |
DirectSumModule |
getModule()
Returns the module that this module element is an element of. |
Ring |
getRing()
|
static XMLInputOutput<ModuleElement> |
getXMLInputOutput()
|
int |
hashCode()
Returns the hash code for this module element. |
boolean |
isNullElement()
|
boolean |
isZero()
Returns true iff this element is zero. |
static DirectSumElement |
make(ModuleElement[] components)
|
static DirectSumElement |
makeNullElement(Ring ring)
|
void |
negate()
Negate this module element. |
DirectSumElement |
negated()
Returns the negative of this module element. |
void |
scale(RingElement element)
Multiplies this element with element . |
DirectSumElement |
scaled(RingElement element)
Returns the product of this element with element . |
java.lang.String |
stringRep(boolean... parens)
Returns a string representation of this module element. |
void |
subtract(ModuleElement element)
Subtracts element from this module element. |
DirectSumElement |
sum(ModuleElement element)
Returns the sum of this module element and element . |
java.lang.String |
toString()
Returns a human readable string representation of this module element. |
void |
toXML(XMLWriter writer)
Outputs XML representation to writer . |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static DirectSumElement make(ModuleElement[] components)
public static DirectSumElement makeNullElement(Ring ring)
public boolean isNullElement()
public boolean isZero()
ModuleElement
isZero
in interface ModuleElement
public DirectSumElement sum(ModuleElement element) throws DomainException
ModuleElement
element
.
sum
in interface ModuleElement
DomainException
- if element
is not in domainpublic void add(ModuleElement element) throws DomainException
ModuleElement
element
to this module element.
This is a destructive operation.
add
in interface ModuleElement
DomainException
- if element
is not in domainpublic DirectSumElement difference(ModuleElement element) throws DomainException
ModuleElement
element
.
difference
in interface ModuleElement
DomainException
- if element
is not in domainpublic void subtract(ModuleElement element) throws DomainException
ModuleElement
element
from this module element.
This is a destructive operation.
subtract
in interface ModuleElement
DomainException
- if element
is not in domainpublic DirectSumElement negated()
ModuleElement
negated
in interface ModuleElement
public void negate()
ModuleElement
negate
in interface ModuleElement
public DirectSumElement scaled(RingElement element) throws DomainException
ModuleElement
element
.
scaled
in interface ModuleElement
DomainException
- if element
is not in domainpublic void scale(RingElement element) throws DomainException
ModuleElement
element
.
This is a destructive operation.
scale
in interface ModuleElement
DomainException
- if element
is not in domainpublic ModuleElement getComponent(int i)
ModuleElement
i
-th component element.
getComponent
in interface ModuleElement
public int getLength()
ModuleElement
getLength
in interface ModuleElement
public DirectSumModule getModule()
ModuleElement
getModule
in interface ModuleElement
public Ring getRing()
public boolean equals(java.lang.Object object)
ModuleElement
object
.
equals
in interface ModuleElement
equals
in class java.lang.Object
public int compareTo(ModuleElement object)
ModuleElement
object
.
compareTo
in interface java.lang.Comparable<ModuleElement>
compareTo
in interface ModuleElement
public DirectSumElement clone()
ModuleElement
clone
in interface ModuleElement
clone
in class java.lang.Object
public java.lang.String stringRep(boolean... parens)
ModuleElement
stringRep
in interface ModuleElement
public java.lang.String toString()
ModuleElement
toString
in interface ModuleElement
toString
in class java.lang.Object
public double[] fold(ModuleElement[] elements)
ModuleElement
elements
assuming they are of this same type.
fold
in interface ModuleElement
public double[] foldOne(ModuleElement[] elements, int index)
public ModuleElement cast(Module module)
ModuleElement
cast
in interface ModuleElement
public java.util.List<ModuleElement> flatten()
public void toXML(XMLWriter writer)
XMLInputOutput
writer
.
toXML
in interface XMLInputOutput<ModuleElement>
public ModuleElement fromXML(XMLReader reader, org.w3c.dom.Element element)
XMLInputOutput
reader
starting with element
.
fromXML
in interface XMLInputOutput<ModuleElement>
public static XMLInputOutput<ModuleElement> getXMLInputOutput()
public java.lang.String getElementTypeName()
XMLInputOutput
getElementTypeName
in interface XMLInputOutput<ModuleElement>
public int hashCode()
ModuleElement
hashCode
in interface ModuleElement
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |