Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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()".

Version:
  $Revision: 668329 $ $Date: 2008-06-16 16:59:48 -0500 (Mon, 16 Jun 2008) $
Author:
  Dmitri Plotnikov

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
`CoreFunction(int functionCode, Expression[] args)` Create a new CoreFunction.

Method Summary
`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` | `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()` Return the number of argument Expressions.
`int` | `getFunctionCode()` Get the function code.
`protected String` | `getFunctionName()` Get 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 Detail

### CoreFunction

    public CoreFunction(int functionCode,
                        Expression[] args)

  Create a new CoreFunction.

  Parameters:
    `functionCode` - int function code
    `args` - argument Expressions

Method Detail

### getFunctionCode

    public int getFunctionCode()

  Get the function code.

  Returns:
    int function code

### getFunctionName

    protected String getFunctionName()

  Get the name of this function.

  Returns:
    String function name

### 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()

  Return the number of argument Expressions.

  Returns:
    int count

### 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

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### 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

### 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

### functionLast

    protected Object functionLast(EvalContext context)

  last() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionPosition

    protected Object functionPosition(EvalContext context)

  position() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionCount

    protected Object functionCount(EvalContext context)

  count() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionLang

    protected Object functionLang(EvalContext context)

  lang() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean

### 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

### functionNamespaceURI

    protected Object functionNamespaceURI(EvalContext context)

  namespace-uri() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### 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

### functionString

    protected Object functionString(EvalContext context)

  string() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionConcat

    protected Object functionConcat(EvalContext context)

  concat() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionStartsWith

    protected Object functionStartsWith(EvalContext context)

  starts-with() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean

### functionContains

    protected Object functionContains(EvalContext context)

  contains() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean

### functionSubstringBefore

    protected Object functionSubstringBefore(EvalContext context)

  substring-before() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionSubstringAfter

    protected Object functionSubstringAfter(EvalContext context)

  substring-after() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionSubstring

    protected Object functionSubstring(EvalContext context)

  substring() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionStringLength

    protected Object functionStringLength(EvalContext context)

  string-length() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionNormalizeSpace

    protected Object functionNormalizeSpace(EvalContext context)

  normalize-space() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionTranslate

    protected Object functionTranslate(EvalContext context)

  translate() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    String

### functionBoolean

    protected Object functionBoolean(EvalContext context)

  boolean() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean

### functionNot

    protected Object functionNot(EvalContext context)

  not() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean

### functionTrue

    protected Object functionTrue(EvalContext context)

  true() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean.TRUE

### functionFalse

    protected Object functionFalse(EvalContext context)

  false() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Boolean.FALSE

### 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

### functionSum

    protected Object functionSum(EvalContext context)

  sum() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionFloor

    protected Object functionFloor(EvalContext context)

  floor() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionCeiling

    protected Object functionCeiling(EvalContext context)

  ceiling() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

### functionRound

    protected Object functionRound(EvalContext context)

  round() implementation.

  Parameters:
    `context` - evaluation context
  Returns:
    Number

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.