@@ -147,6 +147,59 @@ public <T> boolean fieldBoolean(Class<T> componentClass, int index, String field
147147 return this .fieldPtr (componentClass , index , fieldName , i , offset ).get (ValueLayout .JAVA_BOOLEAN , offset [0 ]);
148148 }
149149
150+ public <T > byte fieldByte (Class <T > componentClass , int index , String fieldName , int i ) {
151+ long [] offset = new long [1 ];
152+ return this .fieldPtr (componentClass , index , fieldName , i , offset ).get (ValueLayout .JAVA_BYTE , offset [0 ]);
153+ }
154+
155+ public <T > String fieldString (Class <T > componentClass , int index , String fieldName , int i ) {
156+ long [] offset = new long [1 ];
157+ MemorySegment stringPointer = this .fieldPtr (componentClass , index , fieldName , i , offset ).get (ValueLayout .ADDRESS .withByteAlignment (1 ), offset [0 ]);
158+ if (stringPointer .address () == 0 ) {
159+ return null ;
160+ }
161+ return stringPointer .reinterpret (Long .MAX_VALUE ).getString (0 );
162+ }
163+
164+ public <T > void setFieldInt (Class <T > componentClass , int index , String fieldName , int i , int value ) {
165+ long [] offset = new long [1 ];
166+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_INT , offset [0 ], value );
167+ }
168+
169+ public <T > void setFieldFloat (Class <T > componentClass , int index , String fieldName , int i , float value ) {
170+ long [] offset = new long [1 ];
171+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_FLOAT , offset [0 ], value );
172+ }
173+
174+ public <T > void setFieldDouble (Class <T > componentClass , int index , String fieldName , int i , double value ) {
175+ long [] offset = new long [1 ];
176+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_DOUBLE , offset [0 ], value );
177+ }
178+
179+ public <T > void setFieldLong (Class <T > componentClass , int index , String fieldName , int i , long value ) {
180+ long [] offset = new long [1 ];
181+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_LONG , offset [0 ], value );
182+ }
183+
184+ public <T > void setFieldShort (Class <T > componentClass , int index , String fieldName , int i , short value ) {
185+ long [] offset = new long [1 ];
186+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_SHORT , offset [0 ], value );
187+ }
188+
189+ public <T > void setFieldBoolean (Class <T > componentClass , int index , String fieldName , int i , boolean value ) {
190+ long [] offset = new long [1 ];
191+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_BOOLEAN , offset [0 ], value );
192+ }
193+
194+ public <T > void setFieldByte (Class <T > componentClass , int index , String fieldName , int i , byte value ) {
195+ long [] offset = new long [1 ];
196+ this .fieldPtr (componentClass , index , fieldName , i , offset ).set (ValueLayout .JAVA_BYTE , offset [0 ], value );
197+ }
198+
199+ public <T > void setFieldString (Class <T > componentClass , int index , String fieldName , int i , String value ) {
200+ // TODO
201+ }
202+
150203 public long event () {
151204 return ecs_iter_t .event (this .nativeIter );
152205 }
0 commit comments