public abstract class RingElement<RE extends IRingElement<RE>> extends java.lang.Object implements IRingElement<RE>, java.lang.Comparable<RE>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
Constructor and Description |
---|
RingElement() |
Modifier and Type | Method and Description |
---|---|
RE |
apply(MonadicOperator<RE> fun)
Returns the result of applying a specified function to this
FieldElement.
|
RE |
divide(RE val) |
boolean |
equals(java.lang.Object obj)
Determines whether or not two RingElements are equal.
|
boolean |
ge(RE val)
Checks whether this RingElement is mathematically greater than or equal
to another.
|
boolean |
gt(RE val)
Checks whether this RingElement is mathematically greater than another.
|
RE |
invert()
Inverts this ring element (divides one by it)
|
boolean |
isOne()
Tests if this RingElement is the neutral element of multiplication (one).
|
boolean |
isZero()
Tests if this RingElement is the neutral element of addition (zero).
|
boolean |
le(RE val)
Checks whether this RingElement is mathematically less than or equal to
another.
|
boolean |
lt(RE val)
Checks whether this RingElement is mathematically less than another.
|
RE |
norm() |
RE |
subtract(RE val)
Calculates the difference of this RingElement and another one.
|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abs, add, compareTo, getFactory, multiply, negate
private static final long serialVersionUID
public boolean isZero()
isZero
in interface IRingElement<RE extends IRingElement<RE>>
public RE subtract(RE val)
subtract
in interface IRingElement<RE extends IRingElement<RE>>
val
- public boolean isOne()
isOne
in interface IRingElement<RE extends IRingElement<RE>>
public boolean equals(java.lang.Object obj)
equals
in interface IRingElement<RE extends IRingElement<RE>>
equals
in class java.lang.Object
obj
- public RE apply(MonadicOperator<RE> fun)
apply
in interface IRingElement<RE extends IRingElement<RE>>
fun
- the function to applyRingElement
public RE norm()
norm
in interface IRingElement<RE extends IRingElement<RE>>
public boolean lt(RE val)
lt
in interface IRingElement<RE extends IRingElement<RE>>
val
- val
, false
otherwiseInvalidOperationException
- if @code this} and val
are not instances of the
same classpublic boolean gt(RE val)
gt
in interface IRingElement<RE extends IRingElement<RE>>
val
- InvalidOperationException
- if this
and val
are not instances of the
same classpublic boolean le(RE val)
le
in interface IRingElement<RE extends IRingElement<RE>>
val
- val
,
false
otherwiseInvalidOperationException
- if this
and val
are not instances of the
same classpublic boolean ge(RE val)
ge
in interface IRingElement<RE extends IRingElement<RE>>
val
- val
,
false otherwiseInvalidOperationException
- if this
and val
are not instances of the
same classpublic RE divide(RE val) throws DivisionByZeroException, InvalidOperationException
divide
in interface IRingElement<RE extends IRingElement<RE>>
DivisionByZeroException
- if a division is possible for the type, but val
is
the zero element.InvalidOperationException
- as in the general case, an inversion is not possible.public RE invert() throws DivisionByZeroException, InvalidOperationException
IRingElement
invert
in interface IRingElement<RE extends IRingElement<RE>>
DivisionByZeroException
- if an inversion is possible for the type, but the element is
the zero element.InvalidOperationException
- as in the general case, an inversion is not possible.