예제 #1
0
 /**
  * Adds a box to the relevant list based on its position tag.
  *
  * @param box
  */
 public void setColumn(Box box) {
   if (box.getColumn() == 1) left.add(box);
   else if (box.getColumn() == 2) middle.add(box);
   else right.add(box);
 }
예제 #2
0
 private void insert(Box n, ArrayList<Box> a, int i) {
   for (;
       i > 0 && ((Comparable<Integer>) a.get(i - 1).getPosition()).compareTo(n.getPosition()) > 0;
       i--) a.set(i, a.get(i - 1));
   a.set(i, n);
 }