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


Java SortingParams.alpha方法代码示例

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


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

示例1: sortAlpha

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
@Test
public void sortAlpha() {
  jedis.lpush("foo", "1");
  jedis.lpush("foo", "2");
  jedis.lpush("foo", "10");

  SortingParams sp = new SortingParams();
  sp.alpha();

  List<String> result = jedis.sort("foo", sp);

  List<String> expected = new ArrayList<String>();
  expected.add("1");
  expected.add("10");
  expected.add("2");

  assertEquals(expected, result);

  // Binary
  jedis.lpush(bfoo, b1);
  jedis.lpush(bfoo, b2);
  jedis.lpush(bfoo, b10);

  SortingParams bsp = new SortingParams();
  bsp.alpha();

  List<byte[]> bresult = jedis.sort(bfoo, bsp);

  List<byte[]> bexpected = new ArrayList<byte[]>();
  bexpected.add(b1);
  bexpected.add(b10);
  bexpected.add(b2);

  assertByteArrayListEquals(bexpected, bresult);
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:36,代码来源:SortingCommandsTest.java

示例2: sortAlpha

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
@Test
public void sortAlpha() {
  jedis.lpush("foo", "1");
  jedis.lpush("foo", "2");
  jedis.lpush("foo", "10");

  SortingParams sp = new SortingParams();
  sp.alpha();

  List<String> result = jedis.sort("foo", sp);

  List<String> expected = new ArrayList<String>();
  expected.add("1");
  expected.add("10");
  expected.add("2");

  assertEquals(expected, result);

  // Binary
  jedis.lpush(bfoo, b1);
  jedis.lpush(bfoo, b2);
  jedis.lpush(bfoo, b10);

  SortingParams bsp = new SortingParams();
  bsp.alpha();

  List<byte[]> bresult = jedis.sort(bfoo, bsp);

  List<byte[]> bexpected = new ArrayList<byte[]>();
  bexpected.add(b1);
  bexpected.add(b10);
  bexpected.add(b2);

  assertEquals(bexpected, bresult);
}
 
开发者ID:sohutv,项目名称:cachecloud,代码行数:36,代码来源:SortingCommandsTest.java

示例3: sort_alpha_desc

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private List<String> sort_alpha_desc(Jedis j, String key, boolean alpha, boolean desc) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) { 
		sp.alpha() ;
	}

	return j.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:12,代码来源:DefaultRedis.java

示例4: sort_offset_count_alpha_desc

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private List<String> sort_offset_count_alpha_desc(Jedis j, String key, int offset, int count, boolean alpha, boolean desc) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) { 
		sp.alpha() ;
	}
	sp.limit(offset, count);
	
	return j.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:13,代码来源:DefaultRedis.java

示例5: sort_by_alpha_desc_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private List<String> sort_by_alpha_desc_get(Jedis j, String key, String bypattern, boolean alpha, boolean desc, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	return j.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:14,代码来源:DefaultRedis.java

示例6: sort_by_offset_count_alpha_desc_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private List<String> sort_by_offset_count_alpha_desc_get(Jedis j, String key, String bypattern, int offset, int count, boolean alpha, boolean desc, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	sp.limit(offset, count);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	return j.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:15,代码来源:DefaultRedis.java

示例7: sort_alpha_desc_destination

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private Long sort_alpha_desc_destination(Jedis j, String key, boolean alpha, boolean desc, String destination) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) {
		sp.alpha();
	}
	
	return j.sort(key, sp, destination);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:12,代码来源:DefaultRedis.java

示例8: sort_offset_count_alpha_desc_destination

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private Long sort_offset_count_alpha_desc_destination(Jedis j, String key, int offset, int count, boolean alpha, boolean desc, String destination) {
	SortingParams sp = new SortingParams();
	sp.limit(offset, count);
	if (desc) {
		sp.desc();
	}
	if (alpha) {
		sp.alpha();
	}
	return j.sort(key, sp, destination);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:12,代码来源:DefaultRedis.java

示例9: sort_by_alpha_desc_destination_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private Long sort_by_alpha_desc_destination_get(Jedis j, String key, String bypattern, boolean alpha, boolean desc, String destination, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	return j.sort(key, sp, destination);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:14,代码来源:DefaultRedis.java

示例10: sort_by_offset_count_alpha_desc_destination_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private Long sort_by_offset_count_alpha_desc_destination_get(Jedis j, String key, String bypattern, int offset, int count, boolean alpha, boolean desc, String destination, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	sp.limit(offset, count);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	return j.sort(key, sp, destination);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:15,代码来源:DefaultRedis.java

示例11: sort_alpha_desc

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private void sort_alpha_desc(String key, boolean alpha, boolean desc) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) { 
		sp.alpha() ;
	}

	t.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:12,代码来源:DefaultRedisTransaction.java

示例12: sort_offset_count_alpha_desc

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private void sort_offset_count_alpha_desc(String key, int offset, int count, boolean alpha, boolean desc) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) { 
		sp.alpha() ;
	}
	sp.limit(offset, count);
	
	t.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:13,代码来源:DefaultRedisTransaction.java

示例13: sort_by_alpha_desc_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private void sort_by_alpha_desc_get(String key, String bypattern, boolean alpha, boolean desc, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	t.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:14,代码来源:DefaultRedisTransaction.java

示例14: sort_by_offset_count_alpha_desc_get

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private void sort_by_offset_count_alpha_desc_get(String key, String bypattern, int offset, int count, boolean alpha, boolean desc, String... getpatterns) {
	SortingParams sp = new SortingParams();
	sp.by(bypattern);
	sp.get(getpatterns);
	sp.limit(offset, count);
	if (alpha) {
		sp.alpha();
	}
	if (desc) {
		sp.desc();
	}
	
	t.sort(key, sp);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:15,代码来源:DefaultRedisTransaction.java

示例15: sort_alpha_desc_destination

import redis.clients.jedis.SortingParams; //导入方法依赖的package包/类
private void sort_alpha_desc_destination(String key, boolean alpha, boolean desc, String destination) {
	SortingParams sp = new SortingParams();
	if (desc) {
		sp.desc();
	}
	if (alpha) {
		sp.alpha();
	}
	
	t.sort(key, sp, destination);
}
 
开发者ID:mindwind,项目名称:craft-atom,代码行数:12,代码来源:DefaultRedisTransaction.java


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