Create a deep copy of 'ls'. The elements of the returned list are of the same type as the input list.
(List<List<C>> ls)
| 1291 | * type as the input list. |
| 1292 | */ |
| 1293 | public static <C extends Expr> List<List<C>> deepCopy(List<List<C>> ls) { |
| 1294 | Preconditions.checkNotNull(ls); |
| 1295 | List<List<C>> result = new ArrayList<>(ls.size()); |
| 1296 | for (List<C> l : ls) { |
| 1297 | if (l == null) { |
| 1298 | result.add(null); |
| 1299 | continue; |
| 1300 | } |
| 1301 | List<C> l2 = new ArrayList<>(l.size()); |
| 1302 | for (Expr element : l) { |
| 1303 | l2.add((C) element.clone()); |
| 1304 | } |
| 1305 | result.add(l2); |
| 1306 | } |
| 1307 | return result; |
| 1308 | } |
| 1309 | |
| 1310 | /** |
| 1311 | * Create a clone of the expression including analysis state with a different |