Default
Default
In-browser search
Settings
Warning: This file is auto-generated by mix ptc.gen_docs from priv/java_interop.exs.
Manual edits will be overwritten. Edit priv/java_interop.exs instead.
PTC-Lisp emulates a subset of Java interop for LLM compatibility. These are not real JVM calls — they are BEAM-native implementations that mirror the Java API surface LLMs are trained on.
40 interop entries covering 12 Java classes in 13 presentation groups.
See also: Function Reference | PTC-Lisp Specification | Namespace coverage: docs/conformance/index.md
java.lang.Boolean Name Kind Signature Description Notes Boolean/parseBooleanStatic (Boolean/parseBoolean s)Parse "true"/"false" to boolean Matches java.lang.Boolean.parseBoolean: nil/null and every string other than case-insensitive "true" return false; non-string, non-nil inputs raise.
java.lang.Double Name Kind Signature Description Notes Double/NEGATIVE_INFINITYConstant Double/NEGATIVE_INFINITYNegative infinity constant (##-Inf) Double/NaNConstant Double/NaNNot-a-Number constant (##NaN) Double/POSITIVE_INFINITYConstant Double/POSITIVE_INFINITYPositive infinity constant (##Inf) Double/parseDoubleStatic (Double/parseDouble s)Parse string to double Uses Java syntax, whitespace, range, rounding, and bounded NumberFormatException/NullPointerException semantics.
java.lang.Float Name Kind Signature Description Notes Float/parseFloatStatic (Float/parseFloat s)Parse string to float Uses Java syntax, whitespace, range, direct float rounding, and bounded NumberFormatException/NullPointerException semantics.
java.lang.Integer Name Kind Signature Description Notes Integer/parseIntStatic (Integer/parseInt s)Parse string to integer Uses Java decimal syntax, int range checks, and bounded NumberFormatException semantics.
java.lang.Long Name Kind Signature Description Notes Long/parseLongStatic (Long/parseLong s)Parse string to integer Uses Java decimal syntax, long range checks, and bounded NumberFormatException semantics.
java.lang.Math Name Kind Signature Description Notes Math/absStatic (Math/abs x)Return the absolute value using a selected Java primitive overload Preserves int, long, float, or double identity and Java minimum-value overflow. Math/ceilStatic (Math/ceil x)Return the smallest double value not less than the argument Returns a Java double and preserves signed zero and non-finite values. Math/floorStatic (Math/floor x)Return the largest double value not greater than the argument Returns a Java double and preserves signed zero and non-finite values. Math/maxStatic (Math/max x y)Return the greater of two Java primitive values Uses exact primitive overload selection plus Java NaN and signed-zero behavior. Math/minStatic (Math/min x y)Return the smaller of two Java primitive values Uses exact primitive overload selection plus Java NaN and signed-zero behavior. Math/powStatic (Math/pow base exponent)Return the first argument raised to the power of the second Uses the Java double overload and its IEEE 754 special-case table. Math/roundStatic (Math/round x)Round a float to int or double to long with ties toward positive infinity NaN becomes zero and infinities saturate to the selected integer primitive range. Math/sqrtStatic (Math/sqrt x)Return the positive double square root Uses Java double semantics for negative, signed-zero, NaN, and infinite inputs.
java.lang.String Name Kind Signature Description Notes .containsMethod (.contains s substr)Returns true if string contains substring .endsWithMethod (.endsWith s suffix)Returns true if string ends with suffix .indexOfMethod (.indexOf s substr), (.indexOf s substr from-index)Index of first occurrence of substring, or -1 if not found Returns Java UTF-16 code-unit indexes. .lastIndexOfMethod (.lastIndexOf s substr)Index of last occurrence of substring, or -1 if not found Returns Java UTF-16 code-unit indexes. .lengthMethod (.length s)Return the UTF-16 code-unit length of a string Uses Java UTF-16 code units; ordinary PTC count remains grapheme-based. .startsWithMethod (.startsWith s prefix)Returns true if string starts with prefix .substringMethod (.substring s start), (.substring s start end)Extract a substring by UTF-16 code-unit index Uses Java UTF-16 code-unit indexes. A range containing an unpaired surrogate returns invalid_java_string because PTC strings require valid UTF-8. .trimMethod (.trim s)Remove leading and trailing code units from U+0000 through U+0020 Uses Java String.trim semantics, not clojure.string/trim whitespace semantics.
java.lang.System Name Kind Signature Description Notes System/currentTimeMillisStatic (System/currentTimeMillis)Return current time in milliseconds since Unix epoch
java.time.Duration Name Kind Signature Description Notes .toDaysMethod (.toDays duration)Return duration length in whole days Partial days truncate toward zero. .toMillisMethod (.toMillis duration)Return duration length in milliseconds Works on Duration values returned by Duration/between. Duration/betweenStatic (Duration/between start-instant end-instant), (java.time.Duration/between start-instant end-instant)Return a native Duration between two Instants Requires native Instant values; LocalDate, Date, and raw host temporal structs are rejected.
java.time.Instant Name Kind Signature Description Notes .toEpochMilliMethod (.toEpochMilli instant)Return epoch milliseconds from an Instant Preserves nanoseconds natively and raises on Java long overflow. Instant/parseStatic (Instant/parse iso-string), (java.time.Instant/parse iso-string)Parse strict ISO-8601 text to a native Instant An explicit UTC or numeric offset is required; nanoseconds are retained.
java.time.LocalDate Name Kind Signature Description Notes .minusDaysMethod (.minusDays local-date n)Subtract days from a LocalDate Java long coercion is applied to n. .plusDaysMethod (.plusDays local-date n)Add days to a LocalDate Java long coercion is applied to n. .toEpochDayMethod (.toEpochDay local-date)Return LocalDate epoch-day integer Works on LocalDate values returned by LocalDate/parse. LocalDate/parseStatic (LocalDate/parse date-string), (java.time.LocalDate/parse date-string)Parse strict ISO-8601 text to a native LocalDate Date-time text is rejected; class identity is retained natively.
java.time.LocalDate / java.time.Instant Name Kind Signature Description Notes .isAfterMethod (.isAfter a b)Returns true if receiver comes strictly after argument (same-type only) Receiver-owned for LocalDate and Instant; mixed classes are rejected. .isBeforeMethod (.isBefore a b)Returns true if receiver comes strictly before argument (same-type only) Receiver-owned for LocalDate and Instant; mixed classes are rejected.
java.util.Date Name Kind Signature Description Notes .afterMethod (.after date other-date)Returns true if a legacy Date follows another Owned only by java.util.Date. .beforeMethod (.before date other-date)Returns true if a legacy Date precedes another Owned only by java.util.Date. .getTimeMethod (.getTime date)Return exact epoch milliseconds from a legacy Date Owned only by java.util.Date. java.util.Date.Constructor (java.util.Date.), (java.util.Date. epoch-milliseconds), (java.util.Date. legacy-date-string)Construct a native legacy Date from current time, exact milliseconds, or legacy text Integer input is always Java epoch milliseconds. ISO-8601 strings and raw host temporal structs are not Date constructor overloads.