Package io.jawk.jrt
Class ListAssocArray
- All Implemented Interfaces:
AssocArray,Serializable,Cloneable,Map<Object,Object>
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields inherited from interface io.jawk.jrt.AssocArray
BLANK -
Constructor Summary
ConstructorsConstructorDescriptionListAssocArray(List<?> values) Creates a hash-backed associative array from the supplied list. -
Method Summary
Methods inherited from class io.jawk.jrt.HashAssocArray
get, getMapVersion, put, remove, toStringMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCodeMethods inherited from interface io.jawk.jrt.AssocArray
isIn, mapString, putMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
ListAssocArray
Creates a hash-backed associative array from the supplied list.- Parameters:
values- list values to expose as an AWK array
-