I'm a python programmer, but currently I'm reading through Java code to get some ideas. I have no programming experience at all with Java and I don't know how it's possible, but I couldn't get any information using Google about these functions.
if(pv.size() -2 < j)
pv.add(j+1, localpv.get(j));
else
pv.set(j+1, localpv.get(j));
This is the piece of code I need to decypher. pv
and localpv
are both vectors (I believe they are equivalent to lists in python?), and something is added to them. I can guess that one of them is adding them to a vector at a certain position (j+1
), but then I have no idea what the other one does.
Can you please explain those two lines for me and maybe telling what are they equivalent to in python?