<!-- Auto-generated — do not edit by hand -->
# Java Interop Reference for PTC-Lisp

> **Warning:** This file is auto-generated by `mix ptc.gen_docs` from `priv/functions.exs`.
> Manual edits will be overwritten. Edit `priv/functions.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.

17 interop entries across 7 classes.

See also: [Function Reference](function-reference.md) | [PTC-Lisp Specification](ptc-lisp-specification.md)

### java.lang.Double

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `Double/NEGATIVE_INFINITY` | Constant | `Double/NEGATIVE_INFINITY, NEGATIVE_INFINITY` | Negative infinity constant (##-Inf) |  |
| `Double/NaN` | Constant | `Double/NaN, NaN` | Not-a-Number constant (##NaN) |  |
| `Double/POSITIVE_INFINITY` | Constant | `Double/POSITIVE_INFINITY, POSITIVE_INFINITY` | Positive infinity constant (##Inf) |  |


### java.lang.String

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `.contains` | Method | `(.contains s substr)` | Returns true if string contains substring |  |
| `.indexOf` | Method | `(.indexOf s substr), (.indexOf s substr from-index)` | Index of first occurrence of substring, or -1 if not found | Uses grapheme indices (not byte offsets). |
| `.lastIndexOf` | Method | `(.lastIndexOf s substr)` | Index of last occurrence of substring, or -1 if not found | Uses grapheme indices (not byte offsets). |
| `.length` | Method | `(.length s)` | Return the grapheme count of a string | Returns grapheme count (not byte length), matching `count` and `.indexOf` index semantics. |
| `.substring` | Method | `(.substring s start), (.substring s start end)` | Extract a substring by grapheme index | Indices are grapheme-based (not byte offsets). Two-arg form returns graphemes in [start, end). Raises on out-of-range indices (matches Java's StringIndexOutOfBoundsException) — note that (.substring s -1) raises rather than silently returning the last grapheme, which matters when chaining .indexOf. |
| `.toLowerCase` | Method | `(.toLowerCase s)` | Convert string to lower case |  |
| `.toUpperCase` | Method | `(.toUpperCase s)` | Convert string to upper case |  |


### java.lang.System

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `System/currentTimeMillis` | Static | `(System/currentTimeMillis), (currentTimeMillis)` | Return current time in milliseconds since Unix epoch |  |


### java.time.Instant

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `Instant/parse` | Static | `(Instant/parse iso-string), (parse iso-string)` | Parse an ISO-8601 instant/date-time string to a DateTime | Returns an Elixir DateTime. Accepts an offset (`Z`, `+02:00`, …); an offsetless `...T...` string is treated as UTC. `.isBefore` / `.isAfter` / `.getTime` work on the result. A bare `YYYY-MM-DD` string returns a Date instead (see `LocalDate/parse`). Also available as the bare `parse` builtin. |


### java.time.LocalDate

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `LocalDate/parse` | Static | `(LocalDate/parse date-string), (parse date-string)` | Parse an ISO-8601 date string (YYYY-MM-DD) to a Date | Returns an Elixir Date for `YYYY-MM-DD`. If the string carries a time component (`...T...`) it returns a DateTime instead (see `Instant/parse`) — a divergence from Java's strict `LocalDate.parse`. Also available as the bare `parse` builtin. |


### java.time.LocalDate / java.util.Date

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `.isAfter` | Method | `(.isAfter a b)` | Returns true if receiver comes strictly after argument (same-type only) | Works on both LocalDate and DateTime. Mixed types raise an error. |
| `.isBefore` | Method | `(.isBefore a b)` | Returns true if receiver comes strictly before argument (same-type only) | Works on both LocalDate and DateTime. Mixed types raise an error. |


### java.util.Date

| Name | Kind | Signature | Description | Notes |
|------|------|-----------|-------------|-------|
| `.getTime` | Method | `(.getTime date)` | Return Unix timestamp in milliseconds from DateTime |  |
| `java.util.Date.` | Constructor | `(java.util.Date.), (java.util.Date. timestamp-or-string), (java.util.Date. datetime-or-date)` | Construct current UTC time, from a timestamp / ISO-8601 / RFC-2822 string, or pass through an existing temporal value | Returns Elixir DateTime. Accepts integer (seconds or ms auto-detected), ISO-8601 (with or without offset — offsetless is treated as UTC), RFC 2822, or an existing DateTime/NaiveDateTime/Date (Date and NaiveDateTime upgrade to UTC; DateTime returns as-is). Time alone is not accepted (no date component). |

