Java add and set functions
<p>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.</p>

<pre><code>if(pv.size() -2 &lt; j)
     pv.add(j+1, localpv.get(j));
else
     pv.set(j+1, localpv.get(j));
</code></pre>

<p>This is the piece of code I need to decypher. <code>pv</code> and <code>localpv</code> 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 (<code>j+1</code>), but then I have no idea what the other one does.</p>

<p>Can you please explain those two lines for me and maybe telling what are they equivalent to in python?</p>
