java.lang.Object
care.smith.top.top_phenotypic_query.c2reasoner.functions.FunctionEntity
care.smith.top.top_phenotypic_query.c2reasoner.functions.advanced.Switch

public class Switch extends care.smith.top.top_phenotypic_query.c2reasoner.functions.FunctionEntity
The function Switch combines any number of if-then pairs and an optional default expression (else-expression). If one of the if-expressions is true, the corresponding then-expression is returned, otherwise the else-expression. If all if-expressions are false and the else-expression is undefined, a 'missing value' is returned.
Arguments:
Arguments Arguments data types Return data type Example
(<if-exp> <then-exp>)+ [<else-exp>] <if-exp>: boolean
<then-exp>: any (all equal)
<else-exp>: same as all <then-exp>
same as all <then-exp> Switch(Creatinine < 1, 1, Creatinine > 3, 3, Creatinine)
The function returns 1 if the Creatinine value is less than 1,
3 if the Creatinine value is greater than 3,
otherwise the Creatinine value.
Author:
TOP group
  • Method Summary

    Modifier and Type
    Method
    Description
    care.smith.top.model.Expression
    calculate(List<care.smith.top.model.Expression> args, care.smith.top.top_phenotypic_query.c2reasoner.C2R c2r)
     
    static Switch
    get()
     
    static care.smith.top.model.Expression
    of(care.smith.top.model.Expression... args)
     
    static care.smith.top.model.Expression
    of(care.smith.top.model.Phenotype... args)
     
    static care.smith.top.model.Expression
    of(List<care.smith.top.model.Expression> args)
     

    Methods inherited from class care.smith.top.top_phenotypic_query.c2reasoner.functions.FunctionEntity

    getFunction, getFunctionId, getType, maxArgumentNumber, minArgumentNumber, toString, toStringValues

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static Switch get()
    • of

      public static care.smith.top.model.Expression of(List<care.smith.top.model.Expression> args)
    • of

      public static care.smith.top.model.Expression of(care.smith.top.model.Expression... args)
    • of

      public static care.smith.top.model.Expression of(care.smith.top.model.Phenotype... args)
    • calculate

      public care.smith.top.model.Expression calculate(List<care.smith.top.model.Expression> args, care.smith.top.top_phenotypic_query.c2reasoner.C2R c2r)
      Specified by:
      calculate in class care.smith.top.top_phenotypic_query.c2reasoner.functions.FunctionEntity