Class JniYArray

java.lang.Object
net.carcdr.ycrdt.jni.JniYArray
All Implemented Interfaces:
AutoCloseable, net.carcdr.ycrdt.YArray

public class JniYArray extends Object implements net.carcdr.ycrdt.YArray
YArray represents a collaborative array type in a Y-CRDT document.

YArray provides efficient collaborative array operations with automatic conflict resolution. Multiple users can modify the same array simultaneously, and changes will be merged automatically using CRDT algorithms.

This class implements Closeable and should be used with try-with-resources to ensure proper cleanup of native resources.

Example usage:


 try (YDoc doc = new JniYDoc();
      YArray array = doc.getArray("myarray")) {
     array.pushString("Hello");
     array.pushDouble(42.0);
     array.insertString(1, "World");
     System.out.println(array.toJson()); // ["Hello","World",42.0]
 }
 
See Also:
  • YDoc