from_multidimensional_java_arrays

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
from_multidimensional_java_arrays [2025/04/18 17:24]
colinr
from_multidimensional_java_arrays [2025/04/18 17:31] (current)
colinr
Line 1: Line 1:
 +====== Programmatically Creating Complex SecsFormat00 Objects from Java Arrays ======
 +
 +
 ===== 🧩 Convert Mixed-Type Nested Arrays: sf00FromNested(Object data) ===== ===== 🧩 Convert Mixed-Type Nested Arrays: sf00FromNested(Object data) =====
  
 Recursively converts a nested ''Object'' array into a hierarchical SECS structure, inferring SECS types based on the Java type of each leaf element. Recursively converts a nested ''Object'' array into a hierarchical SECS structure, inferring SECS types based on the Java type of each leaf element.
  
-Use this method when your structure may contain integers, floats, doubles, longs, or strings. Each array level becomes a ''SecsFormat00''.+You may use this method when your structure may contain integers, floats, doubles, longs, or strings. Each array level becomes a ''SecsFormat00''.
  
 ==== Example method ==== ==== Example method ====
Line 10: Line 13:
 /** /**
  * Recursively converts a nested {@code Object} (array or leaf) into a hierarchical SECS structure.  * Recursively converts a nested {@code Object} (array or leaf) into a hierarchical SECS structure.
- *+ 
  * Arrays (including multidimensional ones) become nested {@link SecsFormat00}, and leaf elements are converted  * Arrays (including multidimensional ones) become nested {@link SecsFormat00}, and leaf elements are converted
  * to SECS types based on their Java type.  * to SECS types based on their Java type.
Line 64: Line 67:
 ===== 🔤 Convert All-String Nested Arrays: sf00FromNestedStrings(Object data) ===== ===== 🔤 Convert All-String Nested Arrays: sf00FromNestedStrings(Object data) =====
  
-Recursively converts a nested ''Object'' array into a SECS structure assuming all leaf elements are strings or nulls. +Recursively converts a nested ''Object'' array into a SECS structure assuming all leaf elements are strings or nulls. This is often better when you know the expected SecsFormat of your values because the type can be defined explicitly.
- +
-This is more efficient when the format of the data is guaranteed to be string-only and avoids unnecessary type checks.+
  
 ==== Example method ==== ==== Example method ====
Line 124: Line 125:
 ===== 📦 Convert Structured Triple Arrays: sf00FromNestedStructuredTriple(Object data) ===== ===== 📦 Convert Structured Triple Arrays: sf00FromNestedStructuredTriple(Object data) =====
  
-Recursively converts a nested ''Object'' array into a hierarchical SECS structure, assuming all non-array leaves are structured triples of the form Â +Recursively converts a nested ''Object'' array into a hierarchical SECS structure, using explicit types at the leaf. In this example,   
-**[String, Float, Integer]** +Non-array elements are assumed to be leaf-level triples: **[String, Float, Integer]**.  Â 
- +Arrays are recursively processed into nested ''SecsFormat00'' structures.
-Each triple becomes a ''SecsFormat00'' containing those three typed values. Arrays are recursively processed into nested ''SecsFormat00'' structures.+
  
 ==== Example method ==== ==== Example method ====
  • from_multidimensional_java_arrays.1745015090.txt.gz
  • Last modified: 2025/04/18 17:24
  • by colinr