本文整理了Java中com.vaadin.flow.data.provider.Query.getOffset
方法的一些代码示例,展示了Query.getOffset
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getOffset
方法的具体详情如下:
包路径:com.vaadin.flow.data.provider.Query
类名称:Query
方法名:getOffset
[英]Gets the first index of items to fetch. The offset is only used when fetching items, but not when counting the number of available items.
[中]获取要获取的项的第一个索引。偏移量仅在获取项目时使用,但在计算可用项目数时不使用。
代码示例来源:origin: com.vaadin/flow-data
@Override
public int getOffset() {
isOffsetCalled = true;
return super.getOffset();
}
代码示例来源:origin: com.vaadin/flow-data
@Override
public Stream<T> fetch(Query<T, SerializablePredicate<T>> query) {
Stream<T> stream = getFilteredStream(query);
Optional<Comparator<T>> comparing = Stream
.of(query.getInMemorySorting(), sortOrder)
.filter(Objects::nonNull)
.reduce((c1, c2) -> c1.thenComparing(c2));
if (comparing.isPresent()) {
stream = stream.sorted(comparing.get());
}
return stream.skip(query.getOffset()).limit(query.getLimit());
}
代码示例来源:origin: com.vaadin/flow-data
private Query<T, F> mixInSortOrders(Query<T, F> query) {
if (sortOrders.isEmpty()) {
return query;
}
Set<String> sortedPropertyNames = query.getSortOrders().stream()
.map(SortOrder::getSorted).collect(Collectors.toSet());
List<QuerySortOrder> combinedSortOrders = Stream
.concat(query.getSortOrders().stream(),
sortOrders.stream()
.filter(order -> !sortedPropertyNames
.contains(order.getSorted())))
.collect(Collectors.toList());
return new Query<>(query.getOffset(), query.getLimit(),
combinedSortOrders, query.getInMemorySorting(),
query.getFilter().orElse(null));
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
q.offset(query.getOffset());
代码示例来源:origin: com.vaadin/flow-data
@Override
public Stream<T> fetch(Query<T, F> t) {
return dataProvider.fetch(new Query<>(t.getOffset(), t.getLimit(),
t.getSortOrders(), t.getInMemorySorting(), getFilter(t)));
}
代码示例来源:origin: com.vaadin/flow-data
@Override
public int size(Query<T, F> t) {
return dataProvider.size(new Query<>(t.getOffset(), t.getLimit(),
t.getSortOrders(), t.getInMemorySorting(), getFilter(t)));
}
内容来源于网络,如有侵权,请联系作者删除!