Class AbstractFunction

java.lang.Object
org.gvsig.expressionevaluator.spi.AbstractFunction
All Implemented Interfaces:
Function

public abstract class AbstractFunction extends Object implements Function
  • Field Details

  • Constructor Details

    • AbstractFunction

      protected AbstractFunction(String group, String name, org.apache.commons.lang3.Range argc, String description, String template, String[] descriptionArgs, String returnType, boolean sqlCompatible)
    • AbstractFunction

      protected AbstractFunction(String group, String name, org.apache.commons.lang3.Range argc, String description, String template, String[] descriptionArgs, String returnType)
    • AbstractFunction

      protected AbstractFunction(String group, String name, org.apache.commons.lang3.Range argc, String description, String template, String[] descriptionArgs)
    • AbstractFunction

      protected AbstractFunction(String group, String name, org.apache.commons.lang3.Range argc, String description, String template)
    • AbstractFunction

      protected AbstractFunction(String group, String name, org.apache.commons.lang3.Range argc)
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface Function
    • returnType

      public String returnType()
      Specified by:
      returnType in interface Function
    • group

      public String group()
      Specified by:
      group in interface Function
    • argc

      public org.apache.commons.lang3.Range argc()
      Specified by:
      argc in interface Function
    • description

      public String description()
      Specified by:
      description in interface Function
    • descriptionArgs

      public String[] descriptionArgs()
      Specified by:
      descriptionArgs in interface Function
    • setDescription

      public void setDescription(String description)
    • setTemplate

      public void setTemplate(String template)
    • setDescriptionArgs

      public void setDescriptionArgs(String[] descriptionArgs)
    • setReturnType

      public void setReturnType(String returnType)
    • getFullDescription

      public String getFullDescription()
      Description copied from interface: Function
      Return a full description of the funcion internationalized in HTML. This full description contains, t name, description, args, template and return type.
      Specified by:
      getFullDescription in interface Function
      Returns:
      full description in HTML as a String
    • addAlias

      public void addAlias(String name)
      Specified by:
      addAlias in interface Function
    • aliases

      public List<String> aliases()
      Specified by:
      aliases in interface Function
    • template

      public String template()
      Specified by:
      template in interface Function
    • isOperator

      public boolean isOperator()
      Specified by:
      isOperator in interface Function
    • isHidden

      public boolean isHidden()
      Specified by:
      isHidden in interface Function
    • useArgumentsInsteadObjects

      public boolean useArgumentsInsteadObjects()
      Specified by:
      useArgumentsInsteadObjects in interface Function
    • isSQLCompatible

      public boolean isSQLCompatible()
      Specified by:
      isSQLCompatible in interface Function
    • allowConstantFolding

      public boolean allowConstantFolding()
      Description copied from interface: Function
      Returns true if the function always returns the same value for the same parameters. If so, it is possible to optimize the generated code through the process of "constant folding". https://en.wikipedia.org/wiki/Constant_folding
      Specified by:
      allowConstantFolding in interface Function
      Returns:
      true if this function allow constant folding optimization.
    • call

      public Object call(Interpreter interpreter, Codes args) throws Exception
      Specified by:
      call in interface Function
      Throws:
      Exception
    • getInt

      protected int getInt(Object[] args, int n)
    • getInt

      protected int getInt(Object value, int n)
    • getInt

      protected int getInt(Interpreter interpreter, Codes args, int n)
    • getLong

      protected long getLong(Object[] args, int n)
    • getLong

      protected long getLong(Object value, int n)
    • getDouble

      protected double getDouble(Object[] args, int n)
    • getDouble

      protected double getDouble(Object value, int arg)
    • getBigDecimal

      protected BigDecimal getBigDecimal(Object value, int arg)
    • getFloat

      protected float getFloat(Object[] args, int n)
    • getFloat

      protected float getFloat(Object value, int arg)
    • getStr

      protected String getStr(Object[] args, int n)
    • getStr

      protected String getStr(Object value, int n)
    • getFile

      protected File getFile(Object[] args, int n)
    • getFile

      protected File getFile(Object value, int n)
    • isNull

      protected boolean isNull(Object[] args, int n)
    • getObject

      protected Object getObject(Object[] args, int n)
    • getJsonObject

      protected javax.json.JsonObject getJsonObject(Object[] args, int n)
    • getJsonObject

      protected javax.json.JsonObject getJsonObject(Object value, int n)
    • getJsonArray

      protected javax.json.JsonArray getJsonArray(Object[] args, int n)
    • getJsonArray

      protected javax.json.JsonArray getJsonArray(Object value, int n)
    • getJsonStructure

      protected javax.json.JsonStructure getJsonStructure(Object[] args, int n)
    • getJsonStructure

      protected javax.json.JsonStructure getJsonStructure(Object value, int n)
    • getObject

      protected Object getObject(Interpreter interpreter, Codes args, int n)
    • getComparable

      protected Comparable getComparable(Object[] args, int n)
    • getComparable

      protected Comparable getComparable(Object value, int n)
    • getDate

      protected Comparable getDate(Object[] args, int n)
    • getDate

      protected Date getDate(Object value, int n)
    • getLocalDateTime

      protected LocalDateTime getLocalDateTime(Object[] args, int n)
    • getLocalDateTime

      protected LocalDateTime getLocalDateTime(Object value, int n)
    • getURL

      public URL getURL(Object[] args, int index) throws MalformedURLException
      Throws:
      MalformedURLException
    • getBoolean

      protected boolean getBoolean(Object[] args, int n, Double accuracy)
    • getBoolean

      protected boolean getBoolean(Object[] args, int n)
    • getBoolean

      protected boolean getBoolean(Object value, int n)
    • getBoolean

      protected boolean getBoolean(Object value, int n, Double accuracy)
    • getBoolean

      protected boolean getBoolean(Interpreter interpreter, Codes args, int n)
    • toBoolean

      protected boolean toBoolean(Object value, Double accuracy)
    • getList

      protected org.gvsig.tools.util.GetItemWithSize64 getList(Object[] args, int index)
    • getType

      protected int getType(Object op1, Object op2)
    • toString

      public String toString(Codes args, Formatter<Code> formatter)
      Specified by:
      toString in interface Function
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • checkDoubleValue

      protected void checkDoubleValue(double value)
    • checkFloatValue

      protected void checkFloatValue(float value)
    • toValue

      public ExpressionBuilder.Value toValue(ExpressionBuilder builder, Codes parameters)
      Specified by:
      toValue in interface Function