Class ParseUint16


  • public class ParseUint16
    extends PrimitiveFunction
    Primitive function which parses a string into a uint16 (16-bit unsigned integer). Returns an optional value that is empty if the string cannot be parsed or is out of range (0-65535).
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseUint16()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Optional<java.lang.Character> apply​(java.lang.String str)
      Attempts to parse a string into a Character representing uint16 (0-65535).
      protected java.util.function.Function<java.util.List<Term>,​java.util.function.Function<Graph,​Either<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: string -> optional uint16.
      • Methods inherited from class java.lang.Object

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

      • ParseUint16

        public ParseUint16()
    • 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.parseUint16"
      • type

        public TypeScheme type()
        Returns the type scheme for this function: string -> optional uint16.
        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<Graph,​Either<Error_,​Term>>> implementation()
        Provides the implementation of this primitive function.
        Specified by:
        implementation in class PrimitiveFunction
        Returns:
        a function that parses string terms into optional uint16 terms
      • apply

        public static Optional<java.lang.Character> apply​(java.lang.String str)
        Attempts to parse a string into a Character representing uint16 (0-65535).
        Parameters:
        str - the string to parse
        Returns:
        a Optional containing the parsed Character, or empty if parsing fails or value is out of range