Class FItem

All Implemented Interfaces:
Iterable<Item>, XQFunction, XQFunctionExpr
Direct Known Subclasses:
FuncItem, XQData

public abstract class FItem extends Item implements XQFunction
Abstract super class for function items. This class is inherited by XQMap, Array, and FuncItem.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Constructor Details

    • FItem

      protected FItem(FuncType type, AnnList anns)
      Constructor.
      Parameters:
      type - type
      anns - this function item's annotations
  • Method Details

    • annotations

      public final AnnList annotations()
      Description copied from interface: XQFunctionExpr
      Annotations of this function.
      Specified by:
      annotations in interface XQFunctionExpr
      Returns:
      this function's annotations
    • string

      public final byte[] string(InputInfo ii) throws QueryException
      Description copied from class: Item
      Returns a string representation of the value.
      Specified by:
      string in class Item
      Parameters:
      ii - input info (can be null)
      Returns:
      string value
      Throws:
      QueryException - if the item cannot be atomized (caused by function or streaming items)
    • eq

      public final boolean eq(Item item, Collation coll, StaticContext sc, InputInfo ii) throws QueryException
      Description copied from class: Item
      Compares the items for equality.
      Specified by:
      eq in class Item
      Parameters:
      item - item to be compared
      coll - collation (can be null)
      sc - static context; required for comparing items of type xs:QName (can be null)
      ii - input info (can be null)
      Returns:
      result of check
      Throws:
      QueryException - query exception
    • sameKey

      public final boolean sameKey(Item item, InputInfo ii)
      Description copied from class: Item
      Compares the items for equality.
      Overrides:
      sameKey in class Item
      Parameters:
      item - item to be compared
      ii - input info (can be null)
      Returns:
      result of check
    • refineType

      public void refineType(Expr expr)
      Description copied from class: Expr
      Refines the expression type.
      Overrides:
      refineType in class Item
      Parameters:
      expr - original expression
    • funcType

      public final FuncType funcType()
      Description copied from class: Expr
      Returns the function type of this expression.
      Specified by:
      funcType in interface XQFunctionExpr
      Overrides:
      funcType in class Expr
      Returns:
      function type, or null if expression yields no functions
    • coerceTo

      public abstract FItem coerceTo(FuncType ft, QueryContext qc, InputInfo ii, boolean optimize) throws QueryException
      Coerces this function item to the given function type.
      Parameters:
      ft - function type
      qc - query context
      ii - input info
      optimize - optimize resulting item
      Returns:
      coerced item
      Throws:
      QueryException - query exception
    • deep

      public abstract boolean deep(Item item, Collation coll, InputInfo ii) throws QueryException
      Performs a deep comparison of two items.
      Parameters:
      item - item to be compared
      coll - collation (can be null)
      ii - input info
      Returns:
      result of check
      Throws:
      QueryException - query exception