Package io.jawk.jrt

Class ListAssocArray

All Implemented Interfaces:
AssocArray, Serializable, Cloneable, Map<Object,Object>

public final class ListAssocArray extends HashAssocArray
An AWK associative array materialized from a Java List.

The source list is copied once into normal AWK array storage using zero-based Long keys. After construction, this array behaves like any other AssocArray: scripts may add string keys, delete entries, or create sparse numeric indexes without being constrained by List semantics.

This class also owns normalization of nested Java containers supplied from embedding APIs. Java Map instances remain map-backed for performance, while nested List instances are replaced by materialized AssocArray instances. Recursive object graphs are guarded with an identity-based recursion stack so self-referencing maps or lists do not cause infinite conversion.

Author:
MetricsHub
See Also:
  • Constructor Details

    • ListAssocArray

      public ListAssocArray(List<?> values)
      Creates a hash-backed associative array from the supplied list.
      Parameters:
      values - list values to expose as an AWK array