Adding parent class to arraylist with internal function

I apologize for incoherence, Incon is an arraylist nested in the floebox class, Nothing special, just an empty arraylist defined at the start of a class, like this:

class floebox(){
[...]
  ArrayList<connector> incon;
  ArrayList<connector> outcon;
  String[] in, out, TEMPDUMMYPAYLOAD;
  int il, ol, spx, spy, swidth, xofs, yofs;
  floebox(blockmd b, int _spx, int _spy, String _id) {
    name=b.name;
    il=b.in.length;
    ol=b.out.length;
    spx=_spx;
    spy=_spy;
    swidth=int(textWidth(name))+50;
    id=_id;
    outcon=new ArrayList<connector>(ol);
    incon=new ArrayList<connector>(il);
  }
[...]
}

I’m really sorry about the example code, I write really messy spaghetti code and fix it afterwards, if It dosen’t peeve you too much, just tell me what I leave out

1 Like