Class MapType

java.lang.Object
org.basex.query.value.type.FuncType
org.basex.query.value.type.MapType
All Implemented Interfaces:
Type

public final class MapType extends FuncType
Type for maps.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Field Details

    • MAP

      public static final byte[] MAP
      Name.
  • Method Details

    • cast

      public XQMap cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Description copied from interface: Type
      Casts the specified item to this type.
      Specified by:
      cast in interface Type
      Overrides:
      cast in class FuncType
      Parameters:
      item - item to be converted
      qc - query context
      sc - static context
      ii - input info
      Returns:
      cast value
      Throws:
      QueryException - query exception
    • eq

      public boolean eq(Type type)
      Description copied from interface: Type
      Checks if this type is equal to the given one.
      Specified by:
      eq in interface Type
      Overrides:
      eq in class FuncType
      Parameters:
      type - other type
      Returns:
      true if both types are equal, false otherwise
    • instanceOf

      public boolean instanceOf(Type type)
      Description copied from interface: Type
      Checks if the current type is an instance of the specified type.
      Specified by:
      instanceOf in interface Type
      Overrides:
      instanceOf in class FuncType
      Parameters:
      type - type to be checked
      Returns:
      result of check
    • union

      public Type union(Type type)
      Description copied from interface: Type
      Computes the union between this type and the given one, i.e. the least common ancestor of both types in the type hierarchy.
      Specified by:
      union in interface Type
      Overrides:
      union in class FuncType
      Parameters:
      type - other type
      Returns:
      union type
    • intersect

      public Type intersect(Type type)
      Description copied from interface: Type
      Computes the intersection between this type and the given one, i.e. the least specific type that is sub-type of both types. If no such type exists, null is returned.
      Specified by:
      intersect in interface Type
      Overrides:
      intersect in class FuncType
      Parameters:
      type - other type
      Returns:
      intersection type or null
    • keyType

      public AtomType keyType()
      Returns the key type.
      Returns:
      key type
    • get

      public static MapType get(AtomType keyType, SeqType declType)
      Creates a new map type.
      Parameters:
      keyType - key type
      declType - declared return type
      Returns:
      map type
    • toString

      public String toString()
      Specified by:
      toString in interface Type
      Overrides:
      toString in class FuncType