@Test public void testFactoryCopy() { int[] shape1 = new int[] {1, 2, 3}; Array<String> array1 = Arrays.factory(DataType.STRING, shape1, new String[] {"1", "2", "3", "4", "5", "6"}); Array<String> array2 = Arrays.factory(DataType.STRING, shape1, new String[] {"7", "8", "9", "10", "11", "12"}); int[] shape = new int[] {2, 2, 3}; Array<String> array = Arrays.factoryCopy(DataType.STRING, shape, ImmutableList.of(array1, array2)); assertThat(array.get(0, 0, 0)).isEqualTo("1"); assertThat(array.get(0, 0, 1)).isEqualTo("2"); assertThat(array.get(0, 0, 2)).isEqualTo("3"); assertThat(array.get(0, 1, 0)).isEqualTo("4"); assertThat(array.get(0, 1, 1)).isEqualTo("5"); assertThat(array.get(0, 1, 2)).isEqualTo("6"); assertThat(array.get(1, 0, 0)).isEqualTo("7"); assertThat(array.get(1, 0, 1)).isEqualTo("8"); assertThat(array.get(1, 0, 2)).isEqualTo("9"); assertThat(array.get(1, 1, 0)).isEqualTo("10"); assertThat(array.get(1, 1, 1)).isEqualTo("11"); assertThat(array.get(1, 1, 2)).isEqualTo("12"); int count = 0; for (String val : array) { assertThat(val).isEqualTo(String.format("%d", count + 1)); count++; } }
@Override public String get(int... index) { return storage.get(indexFn.get(index)); }
ArrayString extends Array<String> { @Override public String get(int... index) { return storage.get(indexFn.get(index)); } }
ArrayString extends Array<String> { @Override public String get(int... index) { return storage.get(indexFn.get(index)); } ArrayString(int[] shape);  ArrayString(int[] shape, Storage<String> storage); private  ArrayString(IndexFn indexFn, Storage<String> storageD); }
ArrayString extends Array<String> { @Override public String get(int... index) { return storage.get(indexFn.get(index)); } ArrayString(int[] shape);  ArrayString(int[] shape, Storage<String> storage); private  ArrayString(IndexFn indexFn, Storage<String> storageD); @Override Iterator<String> fastIterator(); @Override Iterator<String> iterator(); @Override String get(int... index); @Override String get(Index index); }
ArrayString extends Array<String> { @Override public String get(int... index) { return storage.get(indexFn.get(index)); } ArrayString(int[] shape);  ArrayString(int[] shape, Storage<String> storage); private  ArrayString(IndexFn indexFn, Storage<String> storageD); @Override Iterator<String> fastIterator(); @Override Iterator<String> iterator(); @Override String get(int... index); @Override String get(Index index);  }