Package org.apache.commons.jxpath.ri.compiler

# Class CoreFunction

java.lang.Object
org.apache.commons.jxpath.ri.compiler.Expression
org.apache.commons.jxpath.ri.compiler.Operation
org.apache.commons.jxpath.ri.compiler.CoreFunction

public class CoreFunction extends Operation
An element of the compile tree representing one of built-in functions like "position()" or "number()".

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression

  `Expression.PointerIterator, Expression.ValueIterator`

- ## Field Summary

  ### Fields inherited from class org.apache.commons.jxpath.ri.compiler.Operation

  `args`

  ### Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression

  `NOT_A_NUMBER, ONE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CoreFunction(int functionCode, Expression[] args)`
  Constructs a new CoreFunction.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `compute(EvalContext context)`
  Evaluates the expression.
  `boolean`
  `computeContextDependent()`
  Returns true if any argument is context dependent or if the function is last(), position(), boolean(), local-name(), name(), string(), lang(), number().
  `Object`
  `computeValue(EvalContext context)`
  Evaluates the expression.
  `protected Object`
  `functionBoolean(EvalContext context)`
  boolean() implementation.
  `protected Object`
  `functionCeiling(EvalContext context)`
  ceiling() implementation.
  `protected Object`
  `functionConcat(EvalContext context)`
  concat() implementation.
  `protected Object`
  `functionContains(EvalContext context)`
  contains() implementation.
  `protected Object`
  `functionCount(EvalContext context)`
  count() implementation.
  `protected Object`
  `functionEndsWith(EvalContext context)`
  ends-with() implementation.
  `protected Object`
  `functionFalse(EvalContext context)`
  false() implementation.
  `protected Object`
  `functionFloor(EvalContext context)`
  floor() implementation.
  `protected Object`
  `functionID(EvalContext context)`
  id() implementation.
  `protected Object`
  `functionKey(EvalContext context)`
  key() implementation.
  `protected Object`
  `functionLang(EvalContext context)`
  lang() implementation.
  `protected Object`
  `functionLast(EvalContext context)`
  last() implementation.
  `protected Object`
  `functionLocalName(EvalContext context)`
  local-name() implementation.
  `protected Object`
  `functionName(EvalContext context)`
  name() implementation.
  `protected Object`
  `functionNamespaceURI(EvalContext context)`
  namespace-uri() implementation.
  `protected Object`
  `functionNormalizeSpace(EvalContext context)`
  normalize-space() implementation.
  `protected Object`
  `functionNot(EvalContext context)`
  not() implementation.
  `protected Object`
  `functionNull(EvalContext context)`
  null() implementation.
  `protected Object`
  `functionNumber(EvalContext context)`
  number() implementation.
  `protected Object`
  `functionPosition(EvalContext context)`
  position() implementation.
  `protected Object`
  `functionRound(EvalContext context)`
  round() implementation.
  `protected Object`
  `functionStartsWith(EvalContext context)`
  starts-with() implementation.
  `protected Object`
  `functionString(EvalContext context)`
  string() implementation.
  `protected Object`
  `functionStringLength(EvalContext context)`
  string-length() implementation.
  `protected Object`
  `functionSubstring(EvalContext context)`
  substring() implementation.
  `protected Object`
  `functionSubstringAfter(EvalContext context)`
  substring-after() implementation.
  `protected Object`
  `functionSubstringBefore(EvalContext context)`
  substring-before() implementation.
  `protected Object`
  `functionSum(EvalContext context)`
  sum() implementation.
  `protected Object`
  `functionTranslate(EvalContext context)`
  translate() implementation.
  `protected Object`
  `functionTrue(EvalContext context)`
  true() implementation.
  `Expression`
  `getArg1()`
  Convenience method to return the first argument.
  `Expression`
  `getArg2()`
  Convenience method to return the second argument.
  `Expression`
  `getArg3()`
  Convenience method to return the third argument.
  `int`
  `getArgumentCount()`
  Gets the number of argument Expressions.
  `int`
  `getFunctionCode()`
  Gets the function code.
  `protected String`
  `getFunctionName()`
  Gets the name of this function.
  `String`
  `toString()`

  ### Methods inherited from class org.apache.commons.jxpath.ri.compiler.Operation

  `getArguments`

  ### Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression

  `isContextDependent, iterate, iteratePointers`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CoreFunction

    public CoreFunction(int functionCode, Expression[] args)
    Constructs a new CoreFunction.
    Parameters:
      `functionCode` - int function code
      `args` - argument Expressions

- ## Method Details

  - ### compute

    public Object compute(EvalContext context)
    Description copied from class: `Expression`
    Evaluates the expression. If the result is a node set, returns the first element of the node set.
    Specified by:
      `compute` in class `Expression`
    Parameters:
      `context` - evaluation context
    Returns:
      Object

  - ### computeContextDependent

    public boolean computeContextDependent()
    Returns true if any argument is context dependent or if the function is last(), position(), boolean(), local-name(), name(), string(), lang(), number().
    Overrides:
      `computeContextDependent` in class `Operation`
    Returns:
      boolean

  - ### computeValue

    public Object computeValue(EvalContext context)
    Description copied from class: `Expression`
    Evaluates the expression. If the result is a node set, returns the first element of the node set.
    Specified by:
      `computeValue` in class `Expression`
    Parameters:
      `context` - evaluation context
    Returns:
      Object

  - ### functionBoolean

    protected Object functionBoolean(EvalContext context)
    boolean() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean

  - ### functionCeiling

    protected Object functionCeiling(EvalContext context)
    ceiling() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionConcat

    protected Object functionConcat(EvalContext context)
    concat() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionContains

    protected Object functionContains(EvalContext context)
    contains() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean

  - ### functionCount

    protected Object functionCount(EvalContext context)
    count() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionEndsWith

    protected Object functionEndsWith(EvalContext context)
    ends-with() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean
    Since:
      1.4.0

  - ### functionFalse

    protected Object functionFalse(EvalContext context)
    false() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean.FALSE

  - ### functionFloor

    protected Object functionFloor(EvalContext context)
    floor() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionID

    protected Object functionID(EvalContext context)
    id() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Pointer

  - ### functionKey

    protected Object functionKey(EvalContext context)
    key() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      various Object

  - ### functionLang

    protected Object functionLang(EvalContext context)
    lang() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean

  - ### functionLast

    protected Object functionLast(EvalContext context)
    last() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionLocalName

    protected Object functionLocalName(EvalContext context)
    local-name() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionName

    protected Object functionName(EvalContext context)
    name() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionNamespaceURI

    protected Object functionNamespaceURI(EvalContext context)
    namespace-uri() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionNormalizeSpace

    protected Object functionNormalizeSpace(EvalContext context)
    normalize-space() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionNot

    protected Object functionNot(EvalContext context)
    not() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean

  - ### functionNull

    protected Object functionNull(EvalContext context)
    null() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      null

  - ### functionNumber

    protected Object functionNumber(EvalContext context)
    number() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionPosition

    protected Object functionPosition(EvalContext context)
    position() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionRound

    protected Object functionRound(EvalContext context)
    round() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionStartsWith

    protected Object functionStartsWith(EvalContext context)
    starts-with() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean

  - ### functionString

    protected Object functionString(EvalContext context)
    string() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionStringLength

    protected Object functionStringLength(EvalContext context)
    string-length() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionSubstring

    protected Object functionSubstring(EvalContext context)
    substring() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionSubstringAfter

    protected Object functionSubstringAfter(EvalContext context)
    substring-after() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionSubstringBefore

    protected Object functionSubstringBefore(EvalContext context)
    substring-before() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionSum

    protected Object functionSum(EvalContext context)
    sum() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Number

  - ### functionTranslate

    protected Object functionTranslate(EvalContext context)
    translate() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      String

  - ### functionTrue

    protected Object functionTrue(EvalContext context)
    true() implementation.
    Parameters:
      `context` - evaluation context
    Returns:
      Boolean.TRUE

  - ### getArg1

    public Expression getArg1()
    Convenience method to return the first argument.
    Returns:
      Expression

  - ### getArg2

    public Expression getArg2()
    Convenience method to return the second argument.
    Returns:
      Expression

  - ### getArg3

    public Expression getArg3()
    Convenience method to return the third argument.
    Returns:
      Expression

  - ### getArgumentCount

    public int getArgumentCount()
    Gets the number of argument Expressions.
    Returns:
      int count

  - ### getFunctionCode

    public int getFunctionCode()
    Gets the function code.
    Returns:
      int function code

  - ### getFunctionName

    protected String getFunctionName()
    Gets the name of this function.
    Returns:
      String function name

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`