(int index)
| 22 | public LinkedList() { } |
| 23 | |
| 24 | private Cell<T> find(int index) { |
| 25 | int i = 0; |
| 26 | for (Cell<T> c = front; c != null; c = c.next) { |
| 27 | if (i == index) { |
| 28 | return c; |
| 29 | } |
| 30 | ++ i; |
| 31 | } |
| 32 | throw new IndexOutOfBoundsException(index + " not in [0, " + size + ")"); |
| 33 | } |
| 34 | |
| 35 | private static boolean equal(Object a, Object b) { |
| 36 | return (a == null && b == null) || (a != null && a.equals(b)); |