altering arraylist index in java
<p>let's say i have an array list containing this following:
id, x_coor, y_coor, signal.</p>

<p>the value of id, x_coor, and y_coor are from database and the signal value is generated randomly.</p>

<p>my question is how to reorder the index of the list based on the signal
example:</p>

<pre><code>[0] -&gt; 1, 200, 100, 41
[1] -&gt; 2, 300, 100, 81
[2] -&gt; 3, 100, 300, 20
.
.
.
</code></pre>

<p>i need that list to be</p>

<pre><code>[0] -&gt; 3, 100, 300, 20
[1] -&gt; 1, 200, 100, 41
[2] -&gt; 2, 300, 100, 81
.
.
.
</code></pre>

<p>can someone help? i'm new to java</p>