Package com.singularsys.extensions.field
Interface FieldI
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
MatrixFieldI
- All Known Implementing Classes:
AbstractComparativeField,AbstractMatrixField,BigDecimalField,BigIntegerField,BigIntegerToRationalDecorator,BigModulusField,BooleanField,ComplexField,ComplexFieldWithRealOrder,ComplexFieldWithTotalOrder,ComplexMatrixField,DoubleField,DoubleMatrixField,ExactIntegerField,ExtDocsTest.StringField,ExtDocsTest.StringField2,ExtDocsTest.StringField3,ExternalMatrixField,FieldCollection,FieldConsole.AllToComplexDecorator,FieldConsole.RationalBigDecToDoubleDecorator,FieldConsole.RationalToBigDecDecorator,FieldDecorator,FieldMatrixField,FixedPointField,GenericField,GenericFieldMatrixField,GenericMatrixField,GenericPowerField,IntegerField,IntegerToBigIntegerDecorator,LongField,MatrixFieldCollection,ModulusField,NumberAsBooleanField,NumberToComplexDecorator,NumberToDoubleDecorator,RationalField,SequenceMatrixField,ShortField,SimpleMatrixField,SimpleVectorField,StandardField,StringField
Defines the methods which each field should implement - add, sub, mul, div, mod, pow, eq, ne, gt, ge, lt, le, and, or, not.
The general contract is that if a field can calculate the result then it returns that value.
If a field cannot calculate a value it returns
null.- Author:
- Richard Morris
-
Method Summary
Modifier and TypeMethodDescriptionAdd two members of the field.Logical and.Divides two members of the field.EqualsGreater or equal togetOne()Get the multiplicative identity for this field.getZero()Get the additive identity for this fieldGreater thanLess than or equals toLess thanThe modulus of two members of the field.Multiplies two members of the field.Not EqualsThe negation -x of an element.Logical not.Logical or.The power operator.Subtract two members of the field.
-
Method Details
-
add
Add two members of the field.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
sub
Subtract two members of the field.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
neg
The negation -x of an element.- Parameters:
l- the argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
mul
Multiplies two members of the field.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
div
Divides two members of the field.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
mod
The modulus of two members of the field.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
pow
The power operator.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
eq
Equals- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
ne
Not Equals- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
gt
Greater than- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
ge
Greater or equal to- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
lt
Less than- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
le
Less than or equals to- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
and
Logical and.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
or
Logical or.- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
not
Logical not.- Parameters:
l- argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
getZero
Object getZero()Get the additive identity for this field- Returns:
- object representing zero or null if undefined for this field
-
getOne
Object getOne()Get the multiplicative identity for this field.- Returns:
- object representing one or null if undefined for this field
-