原子序列
parent
9576d7fb68
commit
3e26e9bcd6
|
@ -12,19 +12,19 @@ public interface AtomicSequenceCache<K> extends DecorationKey<K> {
|
|||
/**
|
||||
* 自增
|
||||
*/
|
||||
public Long increment();
|
||||
public Long increment(K key);
|
||||
/**
|
||||
* 自减
|
||||
*/
|
||||
public Long decrement();
|
||||
public Long decrement(K key);
|
||||
|
||||
/**
|
||||
* 增加数值
|
||||
*/
|
||||
public Long increment(Long number);
|
||||
public Long increment(K key, Long number);
|
||||
|
||||
/**
|
||||
* 减少数值
|
||||
*/
|
||||
public Long decrement(Long number);
|
||||
public Long decrement(K key, Long number);
|
||||
}
|
||||
|
|
|
@ -16,37 +16,42 @@ public abstract class AtomicSequenceCacheAbs<K> implements AtomicSequenceCache<K
|
|||
|
||||
/**
|
||||
* 自增
|
||||
* @param key
|
||||
*/
|
||||
@Override
|
||||
public Long increment () {
|
||||
return null;
|
||||
public Long increment (K key) {
|
||||
return this.increment(key, 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自减
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
@Override
|
||||
public Long decrement () {
|
||||
return null;
|
||||
public Long decrement (K key) {
|
||||
return this.decrement(key, 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加数值
|
||||
*
|
||||
* @param key
|
||||
* @param number
|
||||
*/
|
||||
@Override
|
||||
public Long increment (Long number) {
|
||||
public Long increment (K key, Long number) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 减少数值
|
||||
*
|
||||
* @param key
|
||||
* @param number
|
||||
*/
|
||||
@Override
|
||||
public Long decrement (Long number) {
|
||||
public Long decrement (K key, Long number) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue