public class RedissonBitSet extends RedissonObject implements RBitSet
codec, commandExecutor, name
Constructor and Description |
---|
RedissonBitSet(CommandAsyncExecutor connectionManager,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
and(String... bitSetNames)
Executes AND operation over this object and specified bitsets.
|
RFuture<Void> |
andAsync(String... bitSetNames)
Executes AND operation over this object and specified bitsets.
|
BitSet |
asBitSet() |
long |
cardinality()
Returns the number of bits set to one.
|
RFuture<Long> |
cardinalityAsync()
Returns the number of bits set to one.
|
void |
clear()
Set all bits to zero
|
boolean |
clear(long bitIndex)
Set bit to zero at specified
bitIndex |
void |
clear(long fromIndex,
long toIndex)
Set all bits to zero from
fromIndex (inclusive) to toIndex (exclusive) |
RFuture<Void> |
clearAsync()
Set all bits to zero
|
RFuture<Boolean> |
clearAsync(long bitIndex)
Set bit to zero at specified
bitIndex |
RFuture<Void> |
clearAsync(long fromIndex,
long toIndex)
Set all bits to zero from
fromIndex (inclusive) to toIndex (exclusive) |
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
protected RFuture<Boolean> |
clearExpireAsync(String... keys) |
boolean |
expire(Instant instant)
Set an expire date for object.
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(Instant instant)
Set an expire date for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
protected RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit,
String... keys) |
boolean |
expireAt(Date timestamp)
Use
RExpirable.expire(Instant) instead |
boolean |
expireAt(long timestamp)
Use
RExpirable.expire(Instant) instead |
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Use
RExpirableAsync.expireAsync(Instant) instead |
RFuture<Boolean> |
expireAtAsync(long timestamp)
Use
RExpirableAsync.expireAsync(Instant) instead |
protected RFuture<Boolean> |
expireAtAsync(long timestamp,
String... keys) |
boolean |
get(long bitIndex)
Returns
true if bit set to one and false overwise. |
RFuture<Boolean> |
getAsync(long bitIndex)
Returns
true if bit set to one and false overwise. |
byte |
getByte(long offset)
Returns byte number at specified
offset |
RFuture<Byte> |
getByteAsync(long offset)
Returns byte number at specified
offset |
int |
getInteger(long offset)
Returns integer number at specified
offset |
RFuture<Integer> |
getIntegerAsync(long offset)
Returns integer number at specified
offset |
long |
getLong(long offset)
Returns long number at specified
offset |
RFuture<Long> |
getLongAsync(long offset)
Returns long number at specified
offset |
short |
getShort(long offset)
Returns short number at specified
offset |
RFuture<Short> |
getShortAsync(long offset)
Returns short number at specified
offset |
byte |
incrementAndGetByte(long offset,
byte increment)
Increments current byte value on defined
increment value at specified offset
and returns result. |
RFuture<Byte> |
incrementAndGetByteAsync(long offset,
byte increment)
Increments current byte value on defined
increment value at specified offset
and returns result. |
int |
incrementAndGetInteger(long offset,
int increment)
Increments current integer value on defined
increment value at specified offset
and returns result. |
RFuture<Integer> |
incrementAndGetIntegerAsync(long offset,
int increment)
Increments current integer value on defined
increment value at specified offset
and returns result. |
long |
incrementAndGetLong(long offset,
long increment)
Increments current long value on defined
increment value at specified offset
and returns result. |
RFuture<Long> |
incrementAndGetLongAsync(long offset,
long increment)
Increments current long value on defined
increment value at specified offset
and returns result. |
short |
incrementAndGetShort(long offset,
short increment)
Increments current short value on defined
increment value at specified offset
and returns result. |
RFuture<Short> |
incrementAndGetShortAsync(long offset,
short increment)
Increments current short value on defined
increment value at specified offset
and returns result. |
long |
length()
Returns "logical size" = index of highest set bit plus one.
|
RFuture<Long> |
lengthAsync()
Returns "logical size" = index of highest set bit plus one.
|
void |
not()
Executes NOT operation over all bits
|
RFuture<Void> |
notAsync()
Executes NOT operation over all bits
|
void |
or(String... bitSetNames)
Executes OR operation over this object and specified bitsets.
|
RFuture<Void> |
orAsync(String... bitSetNames)
Executes OR operation over this object and specified bitsets.
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
void |
set(BitSet bs)
Copy bits state of source BitSet object to this object
|
boolean |
set(long bitIndex)
Set bit to one at specified bitIndex
|
boolean |
set(long bitIndex,
boolean value)
Set bit to
value at specified bitIndex |
void |
set(long fromIndex,
long toIndex)
Set all bits to one from
fromIndex (inclusive) to toIndex (exclusive) |
void |
set(long fromIndex,
long toIndex,
boolean value)
Set all bits to
value from fromIndex (inclusive) to toIndex (exclusive) |
RFuture<Void> |
setAsync(BitSet bs)
Copy bits state of source BitSet object to this object
|
RFuture<Boolean> |
setAsync(long bitIndex)
Set bit to one at specified bitIndex
|
RFuture<Boolean> |
setAsync(long bitIndex,
boolean value)
Set bit to
value at specified bitIndex |
RFuture<Void> |
setAsync(long fromIndex,
long toIndex)
Set all bits to one from
fromIndex (inclusive) to toIndex (exclusive) |
RFuture<Void> |
setAsync(long fromIndex,
long toIndex,
boolean value)
Set all bits to
value from fromIndex (inclusive) to toIndex (exclusive) |
byte |
setByte(long offset,
byte value)
Returns previous value of byte number and replaces it
with defined
value at specified offset |
RFuture<Byte> |
setByteAsync(long offset,
byte value)
Returns previous value of byte number and replaces it
with defined
value at specified offset |
int |
setInteger(long offset,
int value)
Returns previous value of integer number and replaces it
with defined
value at specified offset |
RFuture<Integer> |
setIntegerAsync(long offset,
int value)
Returns previous value of integer number and replaces it
with defined
value at specified offset |
long |
setLong(long offset,
long value)
Returns previous value of long number and replaces it
with defined
value at specified offset |
RFuture<Long> |
setLongAsync(long offset,
long value)
Returns previous value of long number and replaces it
with defined
value at specified offset |
short |
setShort(long offset,
short value)
Returns previous value of short number and replaces it
with defined
value at specified offset |
RFuture<Short> |
setShortAsync(long offset,
short value)
Returns previous value of short number and replaces it
with defined
value at specified offset |
long |
size()
Returns number of set bits.
|
RFuture<Long> |
sizeAsync()
Returns number of set bits.
|
byte[] |
toByteArray() |
RFuture<byte[]> |
toByteArrayAsync() |
protected int |
toInt(boolean value) |
String |
toString() |
void |
xor(String... bitSetNames)
Executes XOR operation over this object and specified bitsets.
|
RFuture<Void> |
xorAsync(String... bitSetNames)
Executes XOR operation over this object and specified bitsets.
|
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
public RedissonBitSet(CommandAsyncExecutor connectionManager, String name)
public byte getByte(long offset)
RBitSet
offset
public byte setByte(long offset, byte value)
RBitSet
value
at specified offset
public byte incrementAndGetByte(long offset, byte increment)
RBitSet
increment
value at specified offset
and returns result.incrementAndGetByte
in interface RBitSet
offset
- - offset of numberincrement
- - increment valuepublic short getShort(long offset)
RBitSet
offset
public short setShort(long offset, short value)
RBitSet
value
at specified offset
public short incrementAndGetShort(long offset, short increment)
RBitSet
increment
value at specified offset
and returns result.incrementAndGetShort
in interface RBitSet
offset
- - offset of numberincrement
- - increment valuepublic int getInteger(long offset)
RBitSet
offset
getInteger
in interface RBitSet
offset
- - offset of numberpublic int setInteger(long offset, int value)
RBitSet
value
at specified offset
setInteger
in interface RBitSet
offset
- - offset of numbervalue
- - value of numberpublic int incrementAndGetInteger(long offset, int increment)
RBitSet
increment
value at specified offset
and returns result.incrementAndGetInteger
in interface RBitSet
offset
- - offset of numberincrement
- - increment valuepublic long getLong(long offset)
RBitSet
offset
public long setLong(long offset, long value)
RBitSet
value
at specified offset
public long incrementAndGetLong(long offset, long increment)
RBitSet
increment
value at specified offset
and returns result.incrementAndGetLong
in interface RBitSet
offset
- - offset of numberincrement
- - increment valuepublic RFuture<Byte> getByteAsync(long offset)
RBitSetAsync
offset
getByteAsync
in interface RBitSetAsync
offset
- - offset of numberpublic RFuture<Byte> setByteAsync(long offset, byte value)
RBitSetAsync
value
at specified offset
setByteAsync
in interface RBitSetAsync
offset
- - offset of numbervalue
- - value of numberpublic RFuture<Byte> incrementAndGetByteAsync(long offset, byte increment)
RBitSetAsync
increment
value at specified offset
and returns result.incrementAndGetByteAsync
in interface RBitSetAsync
offset
- - offset of numberincrement
- - increment valuepublic RFuture<Short> getShortAsync(long offset)
RBitSetAsync
offset
getShortAsync
in interface RBitSetAsync
offset
- - offset of numberpublic RFuture<Short> setShortAsync(long offset, short value)
RBitSetAsync
value
at specified offset
setShortAsync
in interface RBitSetAsync
offset
- - offset of numbervalue
- - value of numberpublic RFuture<Short> incrementAndGetShortAsync(long offset, short increment)
RBitSetAsync
increment
value at specified offset
and returns result.incrementAndGetShortAsync
in interface RBitSetAsync
offset
- - offset of numberincrement
- - increment valuepublic RFuture<Integer> getIntegerAsync(long offset)
RBitSetAsync
offset
getIntegerAsync
in interface RBitSetAsync
offset
- - offset of numberpublic RFuture<Integer> setIntegerAsync(long offset, int value)
RBitSetAsync
value
at specified offset
setIntegerAsync
in interface RBitSetAsync
offset
- - offset of numbervalue
- - value of numberpublic RFuture<Integer> incrementAndGetIntegerAsync(long offset, int increment)
RBitSetAsync
increment
value at specified offset
and returns result.incrementAndGetIntegerAsync
in interface RBitSetAsync
offset
- - offset of numberincrement
- - increment valuepublic RFuture<Long> getLongAsync(long offset)
RBitSetAsync
offset
getLongAsync
in interface RBitSetAsync
offset
- - offset of numberpublic RFuture<Long> setLongAsync(long offset, long value)
RBitSetAsync
value
at specified offset
setLongAsync
in interface RBitSetAsync
offset
- - offset of numbervalue
- - value of numberpublic RFuture<Long> incrementAndGetLongAsync(long offset, long increment)
RBitSetAsync
increment
value at specified offset
and returns result.incrementAndGetLongAsync
in interface RBitSetAsync
offset
- - offset of numberincrement
- - increment valuepublic long length()
RBitSet
public void set(BitSet bs)
RBitSet
public boolean get(long bitIndex)
RBitSet
true
if bit set to one and false
overwise.public RFuture<Boolean> getAsync(long bitIndex)
RBitSetAsync
true
if bit set to one and false
overwise.getAsync
in interface RBitSetAsync
bitIndex
- - index of bittrue
if bit set to one and false
overwise.public boolean set(long bitIndex)
RBitSet
public void set(long fromIndex, long toIndex, boolean value)
RBitSet
value
from fromIndex
(inclusive) to toIndex
(exclusive)public void set(long fromIndex, long toIndex)
RBitSet
fromIndex
(inclusive) to toIndex
(exclusive)public boolean set(long bitIndex, boolean value)
RBitSet
value
at specified bitIndex
public RFuture<Boolean> setAsync(long bitIndex, boolean value)
RBitSetAsync
value
at specified bitIndex
setAsync
in interface RBitSetAsync
bitIndex
- - index of bitvalue
- true = 1, false = 0true
- if previous value was true,
false
- if previous value was falseprotected int toInt(boolean value)
public byte[] toByteArray()
toByteArray
in interface RBitSet
public RFuture<byte[]> toByteArrayAsync()
toByteArrayAsync
in interface RBitSetAsync
public long cardinality()
RBitSet
cardinality
in interface RBitSet
public long size()
RBitSet
public void clear(long fromIndex, long toIndex)
RBitSet
fromIndex
(inclusive) to toIndex
(exclusive)public boolean clear(long bitIndex)
RBitSet
bitIndex
public void clear()
RBitSet
public void or(String... bitSetNames)
RBitSet
public void and(String... bitSetNames)
RBitSet
public void xor(String... bitSetNames)
RBitSet
public void not()
RBitSet
public RFuture<Long> lengthAsync()
RBitSetAsync
lengthAsync
in interface RBitSetAsync
public RFuture<Void> setAsync(long fromIndex, long toIndex, boolean value)
RBitSetAsync
value
from fromIndex
(inclusive) to toIndex
(exclusive)setAsync
in interface RBitSetAsync
fromIndex
- inclusivetoIndex
- exclusivevalue
- true = 1, false = 0public RFuture<Void> clearAsync(long fromIndex, long toIndex)
RBitSetAsync
fromIndex
(inclusive) to toIndex
(exclusive)clearAsync
in interface RBitSetAsync
fromIndex
- inclusivetoIndex
- exclusivepublic RFuture<Void> setAsync(BitSet bs)
RBitSetAsync
setAsync
in interface RBitSetAsync
bs
- - BitSet sourcepublic RFuture<Void> notAsync()
RBitSetAsync
notAsync
in interface RBitSetAsync
public RFuture<Void> setAsync(long fromIndex, long toIndex)
RBitSetAsync
fromIndex
(inclusive) to toIndex
(exclusive)setAsync
in interface RBitSetAsync
fromIndex
- inclusivetoIndex
- exclusivepublic RFuture<Long> sizeAsync()
RBitSetAsync
sizeAsync
in interface RBitSetAsync
public RFuture<Boolean> setAsync(long bitIndex)
RBitSetAsync
setAsync
in interface RBitSetAsync
bitIndex
- - index of bittrue
- if previous value was true,
false
- if previous value was falsepublic RFuture<Long> cardinalityAsync()
RBitSetAsync
cardinalityAsync
in interface RBitSetAsync
public RFuture<Boolean> clearAsync(long bitIndex)
RBitSetAsync
bitIndex
clearAsync
in interface RBitSetAsync
bitIndex
- - index of bittrue
- if previous value was true,
false
- if previous value was falsepublic RFuture<Void> clearAsync()
RBitSetAsync
clearAsync
in interface RBitSetAsync
public RFuture<Void> orAsync(String... bitSetNames)
RBitSetAsync
orAsync
in interface RBitSetAsync
bitSetNames
- - name of stored bitsetspublic RFuture<Void> andAsync(String... bitSetNames)
RBitSetAsync
andAsync
in interface RBitSetAsync
bitSetNames
- - name of stored bitsetspublic RFuture<Void> xorAsync(String... bitSetNames)
RBitSetAsync
xorAsync
in interface RBitSetAsync
bitSetNames
- - name of stored bitsetspublic boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
RExpirable.expire(Instant)
insteadexpireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
RExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expire(Instant instant)
RExpirable
expire
in interface RExpirable
instant
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAsync(Instant instant)
RExpirableAsync
expireAsync
in interface RExpirableAsync
instant
- - expire datetrue
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
RExpirable.expire(Instant)
insteadexpireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
RExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
true
if the timeout was cleared and false
if notpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
Copyright © 2014–2021 Redisson. All rights reserved.