public class RedisBitSet
extends java.util.BitSet
asBitSet()
. set(int)
).Constructor and Description |
---|
RedisBitSet(java.lang.String host,
int port,
java.lang.String name,
int size)
Constructs an new RedisBitSet.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allSet(int... positions)
Tests whether the provided bit positions are all set.
|
java.util.BitSet |
asBitSet()
Returns the RedisBitSet as a regular BitSet.
|
void |
clear() |
void |
clear(int bitIndex) |
boolean |
get(int bitIndex) |
boolean[] |
getBulk(int... indexes)
Fetches the values at the given index positions in a multi transaction.
|
java.lang.String |
getRedisKey() |
boolean |
isInContext() |
void |
leaveContext()
Leaves the external pipeline or transaction context.
|
void |
overwrite(java.util.BitSet bitSet)
Overwrite the contents of this RedisBitSet by the given BitSet.
|
void |
set(int bitIndex) |
void |
set(int bitIndex,
boolean value) |
void |
set(redis.clients.jedis.Pipeline p,
int bitIndex,
boolean value)
Performs the normal
set(int, boolean) operation using the given pipeline. |
void |
set(redis.clients.jedis.Transaction t,
int bitIndex,
boolean value)
Performs the normal
set(int, boolean) operation using the given transaction. |
int |
size() |
byte[] |
toByteArray() |
java.lang.String |
toString() |
void |
useContext(redis.clients.jedis.Pipeline p)
Uses an external Redis pipeline context for all subsequent modifying operations (like
set(int) ) until
leaveContext() is called. |
void |
useContext(redis.clients.jedis.Transaction t)
Uses an external Redis transaction context for all subsequent modifying operations (like
set(int) ) until
leaveContext() is called. |
public RedisBitSet(java.lang.String host, int port, java.lang.String name, int size)
host
- the Redis hostport
- the Redis Portname
- the name used as key in the databasesize
- the initial size of the RedisBitSetpublic void useContext(redis.clients.jedis.Pipeline p)
set(int)
) until
leaveContext()
is called.p
- The propagated Redis pipelinepublic void useContext(redis.clients.jedis.Transaction t)
set(int)
) until
leaveContext()
is called.t
- The propagated Redis transactionpublic void leaveContext()
public boolean isInContext()
public boolean get(int bitIndex)
get
in class java.util.BitSet
public boolean[] getBulk(int... indexes)
indexes
- the index positions to querypublic void set(int bitIndex, boolean value)
set
in class java.util.BitSet
public void set(redis.clients.jedis.Transaction t, int bitIndex, boolean value)
set(int, boolean)
operation using the given transaction.t
- the propagated transactionbitIndex
- a bit indexvalue
- a boolean value to setpublic void set(redis.clients.jedis.Pipeline p, int bitIndex, boolean value)
set(int, boolean)
operation using the given pipeline.p
- the propagated pipelinebitIndex
- a bit indexvalue
- a boolean value to setpublic void set(int bitIndex)
set
in class java.util.BitSet
public void clear(int bitIndex)
clear
in class java.util.BitSet
public void clear()
clear
in class java.util.BitSet
public int size()
size
in class java.util.BitSet
public byte[] toByteArray()
toByteArray
in class java.util.BitSet
public java.util.BitSet asBitSet()
public void overwrite(java.util.BitSet bitSet)
bitSet
- a regular BitSet used to overwrite this RedisBitSetpublic java.lang.String toString()
toString
in class java.util.BitSet
public java.lang.String getRedisKey()
public boolean allSet(int... positions)
positions
- the positions to test