Class BigintToInt64


  • public class BigintToInt64
    extends PrimitiveFunction
    Primitive function which converts a bigint (arbitrary-precision integer) to an int64 (64-bit signed integer). This conversion may result in loss of precision if the value is outside the int64 range.
    • Constructor Summary

      Constructors 
      Constructor Description
      BigintToInt64()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Long apply​(java.math.BigInteger value)
      Converts a BigInteger value to a Long (64-bit signed integer).
      protected java.util.function.Function<java.util.List<Term>,​java.util.function.Function<Context,​java.util.function.Function<Graph,​Either<InContext<Error_>,​Term>>>> implementation()
      Provides the implementation of this primitive function.
      Name name()
      Returns the unique name identifying this primitive function.
      TypeScheme type()
      Returns the type scheme for this function: bigint -> int64.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BigintToInt64

        public BigintToInt64()
    • Method Detail

      • name

        public Name name()
        Returns the unique name identifying this primitive function.
        Specified by:
        name in class PrimitiveFunction
        Returns:
        the function name "hydra.lib.literals.bigintToInt64"
      • type

        public TypeScheme type()
        Returns the type scheme for this function: bigint -> int64.
        Specified by:
        type in class PrimitiveFunction
        Returns:
        the type scheme representing the function signature
      • implementation

        protected java.util.function.Function<java.util.List<Term>,​java.util.function.Function<Context,​java.util.function.Function<Graph,​Either<InContext<Error_>,​Term>>>> implementation()
        Provides the implementation of this primitive function.
        Specified by:
        implementation in class PrimitiveFunction
        Returns:
        a function that converts bigint terms to int64 terms
      • apply

        public static java.lang.Long apply​(java.math.BigInteger value)
        Converts a BigInteger value to a Long (64-bit signed integer).
        Parameters:
        value - the BigInteger value to convert
        Returns:
        the Long representation of the value