@Test public void fillCoords2() { ListInt sizes = new ArrayInt(15,3,2); int[] actualCoords = new int[] {10,0,1}; int index = (10 * 3 + 0) * 2 + 1; int[] coords = new int[3]; InvertListNumber.fillCoords(coords, index, sizes); assertThat(coords, equalTo(actualCoords)); }
static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } }
InvertListNumber implements ListNumber { static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } } }
InvertListNumber implements ListNumber { static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } }  }
InvertListNumber implements ListNumber { static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } }   }
InvertListNumber implements ListNumber { static void fillCoords(int[] coords, int index, ListInt sizes) { for (int i = 0; i < coords.length; i++) { int revI = sizes.size() - i - 1; int size = sizes.getInt(revI); coords[revI] = index % size; index = index / size; } }    }