OK, I look at your code, which seems OK (I am not specialist of L-systems...). I will just make some minor comments on style.
int iterations = 9;I like to add
final to such constant, precisely to show they are constants, and avoid accidental change and such.
Not really needed for such simple code, but at good habit to take.
setupThe reference insists on making
size() call the first one, because code before it might be executed twice. Don't ask me why!
if(result.stat == true)Mmm, personally, I dislike checking a boolean for true or false, I feel it is redundant. Some of my co-workers disagree...
Now, I try and give more explicit names to boolean variables: "stat" doesn't "speak", I can't see at a glance if that's status, state, statistic...
I would write something like:
if (result.isSet) for example.
if(result.stat == false)Grrr!
Just put
else there! If it is not true, it is necessarily false! :-D
String t = "A";
nresult = nresult + t;Sometime, particularly for creation of complex objects, I like to make intermediary variables like that. Here, it is a bit of an overkill, a
nresult += "A"; would have been enough.
buffer.clear();No need to clear a buffer newly created (thus already empty).
I criticized style over content, I fear... :-D
I think you could have stored "A" or "B" in AB class instead of true/false, for example, but it might depend on how you want to make the program evolve.