| 37 | private final transient int[] axesSizeProduct; |
| 38 | |
| 39 | static <E> List<List<E>> create(List<? extends List<? extends E>> lists) { |
| 40 | ImmutableList.Builder<List<E>> axesBuilder = new ImmutableList.Builder<List<E>>(lists.size()); |
| 41 | for (List<? extends E> list : lists) { |
| 42 | List<E> copy = ImmutableList.copyOf(list); |
| 43 | if (copy.isEmpty()) { |
| 44 | return ImmutableList.of(); |
| 45 | } |
| 46 | axesBuilder.add(copy); |
| 47 | } |
| 48 | return new CartesianList<E>(axesBuilder.build()); |
| 49 | } |
| 50 | |
| 51 | CartesianList(ImmutableList<List<E>> axes) { |
| 52 | this.axes = axes; |