Package com.singularsys.exttests
Class ExtDocsTest.StringField3
- java.lang.Object
-
- com.singularsys.extensions.field.implementations.AbstractComparativeField
-
- com.singularsys.extensions.field.implementations.GenericField<java.lang.String>
-
- com.singularsys.exttests.ExtDocsTest.StringField3
-
- All Implemented Interfaces:
FieldI,IntegerConvertor,java.io.Serializable
- Enclosing class:
- ExtDocsTest
public class ExtDocsTest.StringField3 extends GenericField<java.lang.String>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringField3()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringaddG(java.lang.String l, java.lang.String r)Adds two elements of type E.java.lang.Stringcast(java.lang.Object l)Convert the input to type E.java.lang.IntegercmpG(java.lang.String l, java.lang.String r)Compare two objects of the same type.java.lang.StringconvertFromInt(java.lang.Integer l)Attempt to convert argument from an integerjava.lang.IntegerconvertToIntE(java.lang.String l)If possible convert the argument to an Integer to enable integral powers.java.lang.StringdivG(java.lang.String l, java.lang.String r)Divides two elements of type E.java.lang.StringgetOne()Get the multiplicative identity for this field.java.lang.StringgetZero()Get the additive identity for this fieldjava.lang.StringmodG(java.lang.String l, java.lang.String r)Modulus of two elements of type E.java.lang.StringmulG(java.lang.String l, java.lang.String r)Multiplies two elements of type E.java.lang.StringnegG(java.lang.String l)Negates an elements of type E.java.lang.StringpowG(java.lang.String l, java.lang.String r)Raises l to the power of rjava.lang.StringsubG(java.lang.String l, java.lang.String r)Subtracts two elements of type E.-
Methods inherited from class com.singularsys.extensions.field.implementations.GenericField
add, and, cmp, convertToInt, div, mod, mul, neg, not, or, pow, sub
-
-
-
-
Method Detail
-
cast
public java.lang.String cast(java.lang.Object l)
Description copied from class:GenericFieldConvert the input to type E.- Specified by:
castin classGenericField<java.lang.String>- Returns:
- l cast to type E if possible or null if casting is not possible
-
addG
public java.lang.String addG(java.lang.String l, java.lang.String r) throws EvaluationExceptionDescription copied from class:GenericFieldAdds two elements of type E.- Specified by:
addGin classGenericField<java.lang.String>- Parameters:
l- lhs argumentr- rhs argument- Returns:
- the sum
- Throws:
EvaluationException- on error
-
cmpG
public java.lang.Integer cmpG(java.lang.String l, java.lang.String r) throws EvaluationExceptionDescription copied from class:GenericFieldCompare two objects of the same type.- Specified by:
cmpGin classGenericField<java.lang.String>- Parameters:
l- left argumentr- right argument- Returns:
- -1, 0, 1 or null
- Throws:
EvaluationException
-
subG
public java.lang.String subG(java.lang.String l, java.lang.String r)Description copied from class:GenericFieldSubtracts two elements of type E.- Specified by:
subGin classGenericField<java.lang.String>- Parameters:
l- lhs argumentr- rhs argument- Returns:
- the difference
-
negG
public java.lang.String negG(java.lang.String l)
Description copied from class:GenericFieldNegates an elements of type E.- Specified by:
negGin classGenericField<java.lang.String>- Parameters:
l- the argument- Returns:
- the negation
-
mulG
public java.lang.String mulG(java.lang.String l, java.lang.String r)Description copied from class:GenericFieldMultiplies two elements of type E.- Specified by:
mulGin classGenericField<java.lang.String>- Parameters:
l- lhs argumentr- rhs argument- Returns:
- the product
-
divG
public java.lang.String divG(java.lang.String l, java.lang.String r)Description copied from class:GenericFieldDivides two elements of type E.- Specified by:
divGin classGenericField<java.lang.String>- Parameters:
l- numeratorr- denominator- Returns:
- the division
-
modG
public java.lang.String modG(java.lang.String l, java.lang.String r)Description copied from class:GenericFieldModulus of two elements of type E.- Specified by:
modGin classGenericField<java.lang.String>- Parameters:
l- lhs argumentr- rhs argument- Returns:
- the modulus
-
powG
public java.lang.String powG(java.lang.String l, java.lang.String r)Description copied from class:GenericFieldRaises l to the power of r- Specified by:
powGin classGenericField<java.lang.String>- Parameters:
l- lhs argumentr- rhs argument- Returns:
- the power
-
getOne
public java.lang.String getOne()
Description copied from interface:FieldIGet the multiplicative identity for this field.- Specified by:
getOnein interfaceFieldI- Specified by:
getOnein classGenericField<java.lang.String>- Returns:
- object representing one or null if undefined for this field
-
getZero
public java.lang.String getZero()
Description copied from interface:FieldIGet the additive identity for this field- Specified by:
getZeroin interfaceFieldI- Specified by:
getZeroin classGenericField<java.lang.String>- Returns:
- object representing zero or null if undefined for this field
-
convertToIntE
public java.lang.Integer convertToIntE(java.lang.String l) throws EvaluationExceptionDescription copied from class:GenericFieldIf possible convert the argument to an Integer to enable integral powers. If the argument cannot be converted null should be returned and thepowG(E,E)method will be called.- Specified by:
convertToIntEin classGenericField<java.lang.String>- Parameters:
l- argument to convert.- Returns:
- an integer or null if argument cannot be converted
- Throws:
EvaluationException
-
convertFromInt
public java.lang.String convertFromInt(java.lang.Integer l) throws EvaluationExceptionDescription copied from interface:IntegerConvertorAttempt to convert argument from an integer- Specified by:
convertFromIntin interfaceIntegerConvertor- Specified by:
convertFromIntin classGenericField<java.lang.String>- Parameters:
l- value to convert- Returns:
- corresponding value in this field or null if it cannot be converted
- Throws:
EvaluationException- probably never
-
-