klyn.collections.ArraySync.ArraySync
constructor
public native ArraySync(size as Long)
Description

Creates a fixed-size synchronized array.

Primitive numeric and boolean slots are initialized to zero / false. Other ValueType slots each receive a distinct value constructed by T(). The constructor must be accessible without required arguments. Nullable reference slots are initialized to null.

import klyn.collections

values = ArraySync<Int>(3)
print(values)     # fs:[0, 0, 0]
Parameters
ParameterDescription
sizeNumber of elements.
Throws
  • TypeError if a ValueType has no accessible default constructor.
  • ValueException if size is negative.
  • OutOfMemoryError if the element storage exceeds the addressable range or cannot be allocated.