@Test public void nullSource() { assertTrue(provider.getCells(null).isEmpty()); }
public List<Cell> getCells(final HasParent<?> source) { return getCellsOnPath(new Iterator<Object>() { private HasParent<?> myCurrent = source; @Override public boolean hasNext() { return myCurrent != null; } @Override public Object next() { if (myCurrent == null) { throw new NoSuchElementException(); } HasParent<?> current = myCurrent; myCurrent = myCurrent.getParent(); return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }); }
CellProvider { public List<Cell> getCells(final HasParent<?> source) { return getCellsOnPath(new Iterator<Object>() { private HasParent<?> myCurrent = source; @Override public boolean hasNext() { return myCurrent != null; } @Override public Object next() { if (myCurrent == null) { throw new NoSuchElementException(); } HasParent<?> current = myCurrent; myCurrent = myCurrent.getParent(); return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }); } }
CellProvider { public List<Cell> getCells(final HasParent<?> source) { return getCellsOnPath(new Iterator<Object>() { private HasParent<?> myCurrent = source; @Override public boolean hasNext() { return myCurrent != null; } @Override public Object next() { if (myCurrent == null) { throw new NoSuchElementException(); } HasParent<?> current = myCurrent; myCurrent = myCurrent.getParent(); return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }); } private  CellProvider(Mapper<?, ?> enclosingMapper); }
CellProvider { public List<Cell> getCells(final HasParent<?> source) { return getCellsOnPath(new Iterator<Object>() { private HasParent<?> myCurrent = source; @Override public boolean hasNext() { return myCurrent != null; } @Override public Object next() { if (myCurrent == null) { throw new NoSuchElementException(); } HasParent<?> current = myCurrent; myCurrent = myCurrent.getParent(); return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }); } private  CellProvider(Mapper<?, ?> enclosingMapper); static CellProvider fromMapper(Mapper<?, ?> mapper); List<Cell> getCells(final HasParent<?> source); List<Cell> getCellsOnPath(Iterable<?> sourcePath); List<Cell> getCellsOnPath(Iterator<?> sourcePath); List<Cell> getCells(Object source); Object getSource(Cell cell); Object getSource(Cell cell, Predicate<Object> predicate); }
CellProvider { public List<Cell> getCells(final HasParent<?> source) { return getCellsOnPath(new Iterator<Object>() { private HasParent<?> myCurrent = source; @Override public boolean hasNext() { return myCurrent != null; } @Override public Object next() { if (myCurrent == null) { throw new NoSuchElementException(); } HasParent<?> current = myCurrent; myCurrent = myCurrent.getParent(); return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }); } private  CellProvider(Mapper<?, ?> enclosingMapper); static CellProvider fromMapper(Mapper<?, ?> mapper); List<Cell> getCells(final HasParent<?> source); List<Cell> getCellsOnPath(Iterable<?> sourcePath); List<Cell> getCellsOnPath(Iterator<?> sourcePath); List<Cell> getCells(Object source); Object getSource(Cell cell); Object getSource(Cell cell, Predicate<Object> predicate);  }