@Test public void GetRowValue() { dataSource.prepare(0, 9, Collections.<SortConstraint> emptyList()); for (int i = 0; i < 10; i++) { dataSource.getRowValue(i); } dataSource.prepare(10, 19, Collections.<SortConstraint> emptyList()); for (int i = 10; i < 20; i++) { dataSource.getRowValue(i); } dataSource.prepare(240, 249, Collections.<SortConstraint> emptyList()); for (int i = 240; i < 250; i++) { dataSource.getRowValue(i); } }
@Override public Object getRowValue(int index) { index = index - startIndex; if (index < preparedResults.size()) { return preparedResults.get(index); } else { logger.error("Invalid index " + index + " (size " + preparedResults.size() + ")"); return null; } }
BeanGridDataSource implements GridDataSource { @Override public Object getRowValue(int index) { index = index - startIndex; if (index < preparedResults.size()) { return preparedResults.get(index); } else { logger.error("Invalid index " + index + " (size " + preparedResults.size() + ")"); return null; } } }
BeanGridDataSource implements GridDataSource { @Override public Object getRowValue(int index) { index = index - startIndex; if (index < preparedResults.size()) { return preparedResults.get(index); } else { logger.error("Invalid index " + index + " (size " + preparedResults.size() + ")"); return null; } } BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive); @SuppressWarnings("unchecked")  BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive, @Nullable Predicate conditions); }
BeanGridDataSource implements GridDataSource { @Override public Object getRowValue(int index) { index = index - startIndex; if (index < preparedResults.size()) { return preparedResults.get(index); } else { logger.error("Invalid index " + index + " (size " + preparedResults.size() + ")"); return null; } } BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive); @SuppressWarnings("unchecked")  BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive, @Nullable Predicate conditions); @Override int getAvailableRows(); @Override void prepare(final int start, final int end, final List<SortConstraint> sortConstraints); @Override Object getRowValue(int index); @Override Class<?> getRowType(); }
BeanGridDataSource implements GridDataSource { @Override public Object getRowValue(int index) { index = index - startIndex; if (index < preparedResults.size()) { return preparedResults.get(index); } else { logger.error("Invalid index " + index + " (size " + preparedResults.size() + ")"); return null; } } BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive); @SuppressWarnings("unchecked")  BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive, @Nullable Predicate conditions); @Override int getAvailableRows(); @Override void prepare(final int start, final int end, final List<SortConstraint> sortConstraints); @Override Object getRowValue(int index); @Override Class<?> getRowType();  }