(Iterable<? extends R> rowKeys, Iterable<? extends C> columnKeys)
| 145 | private final V[][] array; |
| 146 | |
| 147 | private ArrayTable(Iterable<? extends R> rowKeys, Iterable<? extends C> columnKeys) { |
| 148 | this.rowList = ImmutableList.copyOf(rowKeys); |
| 149 | this.columnList = ImmutableList.copyOf(columnKeys); |
| 150 | checkArgument(!rowList.isEmpty()); |
| 151 | checkArgument(!columnList.isEmpty()); |
| 152 | |
| 153 | /* |
| 154 | * TODO(jlevy): Support empty rowKeys or columnKeys? If we do, when |
| 155 | * columnKeys is empty but rowKeys isn't, the table is empty but |
| 156 | * containsRow() can return true and rowKeySet() isn't empty. |
| 157 | */ |
| 158 | rowKeyToIndex = Maps.indexMap(rowList); |
| 159 | columnKeyToIndex = Maps.indexMap(columnList); |
| 160 | |
| 161 | @SuppressWarnings("unchecked") |
| 162 | V[][] tmpArray = (V[][]) new Object[rowList.size()][columnList.size()]; |
| 163 | array = tmpArray; |
| 164 | // Necessary because in GWT the arrays are initialized with "undefined" instead of null. |
| 165 | eraseAll(); |
| 166 | } |
| 167 | |
| 168 | private ArrayTable(Table<R, C, V> table) { |
| 169 | this(table.rowKeySet(), table.columnKeySet()); |
nothing calls this directly
no test coverage detected