Hello everyone, I had an idea to try to make a tool for saving the state of a running program on processing, which could be applied by adding just a couple of lines, I would call it “quick save”. The problem is that in any code there are different objects (containing data variables) that we want to store.
I can’t just take an object and transform it into a JSONObject (to save it as a .json file) and vice versa, as it does in JavaScript.
Question: Is it possible to get the attributes of an object in the form of a list of names and refer to an attribute of an object by name.
It might look like this:
class Like
{
int id = 0; // 0
String members = "mem e"; //1
int Partition = 3; // 2
boolean flag = fasle; // 3
Like () {}
}
Like objectLike = new Like ();
String temp = functionTakesNameOfObjectAttribute (objectLike, 2); // fuction result "Partition", because it is in second place in the class.
int countPartick = functionGetValueToObjectAttribute (objectLike, temp); // read the value of an object variable into a local variable
functionSetValueToObjectAttribute (objectLike, temp, countPartick+1); // value Partition becomes "4"
Is it generally possible to interact with objects in Processing more than is available in Processing itself?