Class NumberAsBooleanField

java.lang.Object
com.singularsys.extensions.field.implementations.NumberAsBooleanField
All Implemented Interfaces:
FieldI, Serializable

public class NumberAsBooleanField extends Object implements FieldI
Treat Numbers as boolean values in And &&, Or || and Not ! as in C. Returns Boolean values.
Author:
Richard Morris
See Also:
  • Constructor Details

    • NumberAsBooleanField

      public NumberAsBooleanField()
  • Method Details

    • and

      public Boolean and(Object l, Object r)
      Description copied from interface: FieldI
      Logical and.
      Specified by:
      and in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      an object representing the result or null if it can not be evaluated.
    • or

      public Boolean or(Object l, Object r)
      Description copied from interface: FieldI
      Logical or.
      Specified by:
      or in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      an object representing the result or null if it can not be evaluated.
    • not

      public Boolean not(Object l)
      Description copied from interface: FieldI
      Logical not.
      Specified by:
      not in interface FieldI
      Parameters:
      l - argument
      Returns:
      an object representing the result or null if it can not be evaluated.
    • eq

      public Boolean eq(Object l, Object r)
      Not implemented for this field.
      Specified by:
      eq in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • ne

      public Boolean ne(Object l, Object r)
      Not implemented for this field.
      Specified by:
      ne in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • gt

      public Boolean gt(Object l, Object r)
      Not implemented for this field.
      Specified by:
      gt in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • ge

      public Boolean ge(Object l, Object r)
      Not implemented for this field.
      Specified by:
      ge in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • lt

      public Boolean lt(Object l, Object r)
      Not implemented for this field.
      Specified by:
      lt in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • le

      public Boolean le(Object l, Object r)
      Not implemented for this field.
      Specified by:
      le in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • add

      public Object add(Object l, Object r)
      Not implemented for this field.
      Specified by:
      add in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • sub

      public Object sub(Object l, Object r)
      Not implemented for this field.
      Specified by:
      sub in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • neg

      public Object neg(Object l)
      Not implemented for this field.
      Specified by:
      neg in interface FieldI
      Parameters:
      l - the argument
      Returns:
      null
    • mul

      public Object mul(Object l, Object r)
      Not implemented for this field.
      Specified by:
      mul in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • div

      public Object div(Object l, Object r)
      Not implemented for this field.
      Specified by:
      div in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • mod

      public Object mod(Object l, Object r)
      Not implemented for this field.
      Specified by:
      mod in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • pow

      public Object pow(Object l, Object r)
      Not implemented for this field.
      Specified by:
      pow in interface FieldI
      Parameters:
      l - left-hand argument
      r - right-hand argument
      Returns:
      null
    • getOne

      public Object getOne()
      Not defined for this field
      Specified by:
      getOne in interface FieldI
      Returns:
      null
    • getZero

      public Object getZero()
      Not defined for this field
      Specified by:
      getZero in interface FieldI
      Returns:
      null