Class ExtDocsTest.StringField3

All Implemented Interfaces:
FieldI, IntegerConvertor, Serializable
Enclosing class:
ExtDocsTest

public static class ExtDocsTest.StringField3 extends GenericField<String>
A implementation of a string field using a GenericField
See Also:
  • Constructor Details

    • StringField3

      public StringField3()
  • Method Details

    • cast

      public String cast(Object l)
      Description copied from class: GenericField
      Convert the input to type E.
      Specified by:
      cast in class GenericField<String>
      Parameters:
      l -
      Returns:
      l cast to type E if possible or null if casting is not possible
    • addG

      public String addG(String l, String r)
      Description copied from class: GenericField
      Adds two elements of type E.
      Specified by:
      addG in class GenericField<String>
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the sum
    • cmpG

      public Integer cmpG(String l, String r)
      Description copied from class: GenericField
      Compare two objects of the same type.
      Specified by:
      cmpG in class GenericField<String>
      Parameters:
      l - left argument
      r - right argument
      Returns:
      -1, 0, 1 or null
    • subG

      public String subG(String l, String r)
      Description copied from class: GenericField
      Subtracts two elements of type E.
      Specified by:
      subG in class GenericField<String>
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the difference
    • negG

      public String negG(String l)
      Description copied from class: GenericField
      Negates an elements of type E.
      Specified by:
      negG in class GenericField<String>
      Parameters:
      l - the argument
      Returns:
      the negation
    • mulG

      public String mulG(String l, String r)
      Description copied from class: GenericField
      Multiplies two elements of type E.
      Specified by:
      mulG in class GenericField<String>
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the product
    • divG

      public String divG(String l, String r)
      Description copied from class: GenericField
      Divides two elements of type E.
      Specified by:
      divG in class GenericField<String>
      Parameters:
      l - numerator
      r - denominator
      Returns:
      the division
    • modG

      public String modG(String l, String r)
      Description copied from class: GenericField
      Modulus of two elements of type E.
      Specified by:
      modG in class GenericField<String>
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the modulus
    • powG

      public String powG(String l, String r)
      Description copied from class: GenericField
      Raises l to the power of r
      Specified by:
      powG in class GenericField<String>
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the power
    • getOne

      public String getOne()
      Description copied from interface: FieldI
      Get the multiplicative identity for this field.
      Specified by:
      getOne in interface FieldI
      Specified by:
      getOne in class GenericField<String>
      Returns:
      object representing one or null if undefined for this field
    • getZero

      public String getZero()
      Description copied from interface: FieldI
      Get the additive identity for this field
      Specified by:
      getZero in interface FieldI
      Specified by:
      getZero in class GenericField<String>
      Returns:
      object representing zero or null if undefined for this field
    • convertToIntE

      public Integer convertToIntE(String l)
      Description copied from class: GenericField
      If possible convert the argument to an Integer to enable integral powers. If the argument cannot be converted null should be returned and the powG(E,E) method will be called.
      Specified by:
      convertToIntE in class GenericField<String>
      Parameters:
      l - argument to convert.
      Returns:
      an integer or null if argument cannot be converted
    • convertFromInt

      public String convertFromInt(Integer l)
      Description copied from interface: IntegerConvertor
      Attempt to convert argument from an integer
      Specified by:
      convertFromInt in interface IntegerConvertor
      Specified by:
      convertFromInt in class GenericField<String>
      Parameters:
      l - value to convert
      Returns:
      corresponding value in this field or null if it cannot be converted