Package hydra.overlay.java.lib.literals
Class ParseUint16
- java.lang.Object
-
- hydra.overlay.java.tools.PrimitiveFunction
-
- hydra.overlay.java.lib.literals.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.Namename()Returns the unique name identifying this primitive function.TypeSchemetype()Returns the type scheme for this function: string -> optional uint16.-
Methods inherited from class hydra.overlay.java.tools.PrimitiveFunction
isPure, lazyParams, term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Returns the unique name identifying this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the function name "hydra.lib.literals.parseUint16"
-
type
public TypeScheme type()
Returns the type scheme for this function: string -> optional uint16.- Specified by:
typein classPrimitiveFunction- 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:
implementationin classPrimitiveFunction- 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
-
-