• 使用SetOperations(无序)操作redis


    方法 c参数 s说明
    Long add(K key, V... values);
    K key:集合key 
    V... values:key对应的值
    向集合中添加一个或多一个元素
    Long remove(K key, Object... values);
    K key:集合key 
    V... values:key对应的值
    删除集合中一个或多个元素
    V pop(K key);
     
    K key:集合key 
    随机删除集合中一个元素
    List<V> pop(K key, long count);
    K key:集合key 
    long count:数量
    随机删除集合中一个或多个元素
    Boolean move(K key, V value, K destKey);
    K key:集合key 
    V value:key对应的某个值
    K destKey:目标集合
    将某一个集合中的元素移动到目标集合中
    Long size(K key);
    K key:集合key 
    获取集合长度
    Boolean isMember(K key, Object o);
    K key:集合key 
    V value:key对应的某个值
    检查集合中是否存在某个元素
    Set<V> intersect(K key, K otherKey);
    K key:集合A的key 
    K otherKey:集合B的key
    获取集合A和集合B的交集
    Set<V> intersect(K key, Collection<K> otherKeys);
     
    K key:集合A的key
    Collection<K> otherKeys:其他集合的集合(可多个)
     获取集合A和其他的交集
     
    Long intersectAndStore(K key, K otherKey, K destKey);
     
    K key:集合A的key 
    K otherKey:集合B的key
    K destKey:集合C的key
     将集合A和集合B的交集存放到集合C中
     
    Long intersectAndStore(K key, Collection<K> otherKeys, K destKey);
     
    K key:集合A的key 
    Collection<K> otherKeys:其他集合的key(可多个)
    K destKey:集合C的key
     将集合A和其他集合的交集存放到集合C中
     
    Set<V> union(K key, K otherKey);
     
    K key:集合A的key 
    K otherKey:集合B的key
     获取集合A和集合B集合合并后的集合
     
    Set<V> union(K key, Collection<K> otherKeys);
     
    K key:集合A的key 
    Collection<K> otherKeys:其他集合的key(可多个)
     获取集合A和其他集合(多个)合并后的集合
     
    Long unionAndStore(K key, K otherKey, K destKey);
     
    K key:集合A的key 
    K otherKey:集合B的key
    K destKey:集合C的key
     将集合A和集合B合并后的结果存放到集合C中
     
    Long unionAndStore(K key, Collection<K> otherKeys, K destKey);
     
    K key:集合A的key 
    Collection<K> otherKeys:其他集合的key(可多个)
    K destKey:集合C的key
     将集合A和其他集合合并后的结果存放到集合C中
     
    Set<V> difference(K key, K otherKey);
     
    K key:集合A的key 
    K otherKey:集合B的key
     获取集合A和集合B的差集
     
    Set<V> difference(K key, Collection<K> otherKeys);
     
    K key:集合A的key 
    Collection<K> otherKeys:其他集合的key(可多个)
     获取集合A和其他集合的差集
     
    Long differenceAndStore(K key, K otherKey, K destKey);
     
    K key:集合A的key 
    K otherKey:集合B的key
    K destKey:集合C的key
     将集合A和集合B的差集存放到集合C中
     
    Long differenceAndStore(K key, Collection<K> otherKeys, K destKey);
     
    K key:集合A的key 
    Collection<K> otherKeys:其他集合的key(可多个)
    K destKey:集合C的key
      将集合A和其他集合的差集存放到集合C中
     
    Set<V> members(K key);
     
    K key:集合A的key 
     获取集合中的多有元素
     
    V randomMember(K key);
     
    K key:集合A的key 
     在集合中随机获取一个元素
     
    Set<V> distinctRandomMembers(K key, long count);
     
    K key:集合A的key 
    count:数量
     在集合中随机获取count个不同的元素
     
    List<V> randomMembers(K key, long count);
     
    K key:集合A的key 
    count:数量
     在集合中随机获取count个元素
     
    Cursor<V> scan(K key, ScanOptions options);
     
    K key:集合A的key 
    ScanOptions options:扫描选项对象
     扫描整个集合一匹配所需元素
  • 相关阅读:
    Jira-dashboard
    SCQA 结构化表达案例:让开场白、讲故事精彩的结构
    outlook 2016 系列1--自动回复
    outlook 2016 系列1--如何将同一回复主题的邮件放在一起
    C++ 成员限定符
    TCP/IP 协议分层
    TCP之拥塞控制
    TCP之流量控制
    TCP之滑动窗口
    TCP中的定时器
  • 原文地址:https://www.cnblogs.com/shiguotao-com/p/10560599.html
Copyright © 2020-2023  润新知