当前位置: 首页>>代码示例>>Java>>正文


Java Query.getInMemorySorting方法代码示例

本文整理汇总了Java中com.vaadin.data.provider.Query.getInMemorySorting方法的典型用法代码示例。如果您正苦于以下问题:Java Query.getInMemorySorting方法的具体用法?Java Query.getInMemorySorting怎么用?Java Query.getInMemorySorting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.data.provider.Query的用法示例。


在下文中一共展示了Query.getInMemorySorting方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testOffsetProvidedByQuery

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
@Test
public void testOffsetProvidedByQuery() {
	Query<String, SerializablePredicate<String>> zeroOffsetQuery = new Query<>();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(zeroOffsetQuery));

	Query<String, SerializablePredicate<String>> singleOffsetQuery = new Query<>(
			1,
			zeroOffsetQuery.getLimit(),
			zeroOffsetQuery.getSortOrders(),
			zeroOffsetQuery.getInMemorySorting(),
			zeroOffsetQuery.getFilter().orElse(null));
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(singleOffsetQuery));
	Assert.assertEquals(controls.getPageLength() - 1, pagedDP.fetch(singleOffsetQuery).count());

	controls.nextPage();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(singleOffsetQuery));
	Assert.assertEquals(controls.getPageLength() - 1, pagedDP.fetch(singleOffsetQuery).count());
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:19,代码来源:PagedDataProviderTest.java

示例2: testLimitProvidedByQuery

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
@Test
public void testLimitProvidedByQuery() {
	Query<String, SerializablePredicate<String>> implicitLimitQuery = new Query<>();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(implicitLimitQuery));

	Query<String, SerializablePredicate<String>> explicitLimitQuery = new Query<>(
			implicitLimitQuery.getOffset(),
			controls.getPageLength() - 1,
			implicitLimitQuery.getSortOrders(),
			implicitLimitQuery.getInMemorySorting(),
			implicitLimitQuery.getFilter().orElse(null));
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(explicitLimitQuery));
	Assert.assertEquals(controls.getPageLength() - 1, pagedDP.fetch(explicitLimitQuery).count());

	controls.nextPage();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(explicitLimitQuery));
	Assert.assertEquals(controls.getPageLength() - 1, pagedDP.fetch(explicitLimitQuery).count());
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:19,代码来源:PagedDataProviderTest.java

示例3: testOffsetAndLimitProvidedByQuery

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
@Test
public void testOffsetAndLimitProvidedByQuery() {
	Query<String, SerializablePredicate<String>> implicitLimitQuery = new Query<>();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(implicitLimitQuery));

	Query<String, SerializablePredicate<String>> explicitLimitQuery = new Query<>(
			1,
			controls.getPageLength() - 2,
			implicitLimitQuery.getSortOrders(),
			implicitLimitQuery.getInMemorySorting(),
			implicitLimitQuery.getFilter().orElse(null));
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(explicitLimitQuery));
	Assert.assertEquals(controls.getPageLength()- 2, pagedDP.fetch(explicitLimitQuery).count());

	controls.nextPage();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(explicitLimitQuery));
	Assert.assertEquals(controls.getPageLength() - 2, pagedDP.fetch(explicitLimitQuery).count());
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:19,代码来源:PagedDataProviderTest.java

示例4: alignQuery

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
<T, F> Query<T, F> alignQuery(Query<T, F> query) {
	BigInteger pageNumber = BigInteger.valueOf(this.pageNumber);
	BigInteger pageLength = BigInteger.valueOf(this.pageLength);
	BigInteger queryOffset = BigInteger.valueOf(query.getOffset());
	BigInteger queryLimit = BigInteger.valueOf(query.getLimit());

	BigInteger maxInteger = BigInteger
			.valueOf(Integer.MAX_VALUE);

	BigInteger offset = pageNumber
			.multiply(pageLength)
			.add(queryOffset)
			.max(BigInteger.ZERO)
			.min(maxInteger);

	BigInteger limit = pageLength.subtract(queryOffset)
			.min(queryLimit)
			.max(BigInteger.ZERO)
			.min(maxInteger);

	return new Query<>(
			offset.intValue(),
			limit.intValue(),
			query.getSortOrders(),
			query.getInMemorySorting(),
			query.getFilter().orElse(null));
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:28,代码来源:PagingControls.java

示例5: testOffsetProvidedByQueryIsOnePageLength

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
@Test
public void testOffsetProvidedByQueryIsOnePageLength() {
	Query<String, SerializablePredicate<String>> zeroOffsetQuery = new Query<>();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(zeroOffsetQuery));

	Query<String, SerializablePredicate<String>> singlePageOffsetQuery = new Query<>(
			controls.getPageLength(),
			zeroOffsetQuery.getLimit(),
			zeroOffsetQuery.getSortOrders(),
			zeroOffsetQuery.getInMemorySorting(),
			zeroOffsetQuery.getFilter().orElse(null));
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(singlePageOffsetQuery));
	Assert.assertEquals(0, pagedDP.fetch(singlePageOffsetQuery).count());
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:15,代码来源:PagedDataProviderTest.java

示例6: testOffsetProvidedByQueryIsTwoPageLengths

import com.vaadin.data.provider.Query; //导入方法依赖的package包/类
@Test
public void testOffsetProvidedByQueryIsTwoPageLengths() {
	Query<String, SerializablePredicate<String>> zeroOffsetQuery = new Query<>();
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(zeroOffsetQuery));

	Query<String, SerializablePredicate<String>> twoPageOffsetQuery = new Query<>(
			controls.getPageLength() * 2,
			zeroOffsetQuery.getLimit(),
			zeroOffsetQuery.getSortOrders(),
			zeroOffsetQuery.getInMemorySorting(),
			zeroOffsetQuery.getFilter().orElse(null));
	Assert.assertEquals(controls.getPageLength(), pagedDP.size(twoPageOffsetQuery));
	Assert.assertEquals(0, pagedDP.fetch(twoPageOffsetQuery).count());
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:15,代码来源:PagedDataProviderTest.java


注:本文中的com.vaadin.data.provider.Query.getInMemorySorting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。