Package org.redisson

Class RedissonBitSet

    • Method Detail

      • length

        public long length()
        Description copied from interface: RBitSet
        Returns "logical size" = index of highest set bit plus one. Returns zero if there are no any set bit.
        Specified by:
        length in interface RBitSet
        Returns:
        "logical size" = index of highest set bit plus one
      • set

        public void set​(BitSet bs)
        Description copied from interface: RBitSet
        Copy bits state of source BitSet object to this object
        Specified by:
        set in interface RBitSet
        Parameters:
        bs - - BitSet source
      • get

        public boolean get​(long bitIndex)
        Description copied from interface: RBitSet
        Returns true if bit set to one and false overwise.
        Specified by:
        get in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true if bit set to one and false overwise.
      • getAsync

        public RFuture<Boolean> getAsync​(long bitIndex)
        Description copied from interface: RBitSetAsync
        Returns true if bit set to one and false overwise.
        Specified by:
        getAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true if bit set to one and false overwise.
      • set

        public boolean set​(long bitIndex)
        Description copied from interface: RBitSet
        Set bit to one at specified bitIndex
        Specified by:
        set in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • set

        public void set​(long fromIndex,
                        long toIndex,
                        boolean value)
        Description copied from interface: RBitSet
        Set all bits to value from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        set in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        value - true = 1, false = 0
      • set

        public void set​(long fromIndex,
                        long toIndex)
        Description copied from interface: RBitSet
        Set all bits to one from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        set in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
      • set

        public void set​(long bitIndex,
                        boolean value)
        Description copied from interface: RBitSet
        Set bit to value at specified bitIndex
        Specified by:
        set in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        value - true = 1, false = 0
      • setAsync

        public RFuture<Boolean> setAsync​(long bitIndex,
                                         boolean value)
        Description copied from interface: RBitSetAsync
        Set bit to value at specified bitIndex
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        value - true = 1, false = 0
        Returns:
        true - if previous value was true, false - if previous value was false
      • toByteArray

        public byte[] toByteArray()
        Specified by:
        toByteArray in interface RBitSet
      • cardinality

        public long cardinality()
        Description copied from interface: RBitSet
        Returns the number of bits set to one.
        Specified by:
        cardinality in interface RBitSet
        Returns:
        number of bits
      • size

        public long size()
        Description copied from interface: RBitSet
        Returns number of set bits.
        Specified by:
        size in interface RBitSet
        Returns:
        number of set bits.
      • clear

        public void clear​(long fromIndex,
                          long toIndex)
        Description copied from interface: RBitSet
        Set all bits to zero from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        clear in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
      • clear

        public boolean clear​(long bitIndex)
        Description copied from interface: RBitSet
        Set bit to zero at specified bitIndex
        Specified by:
        clear in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • clear

        public void clear()
        Description copied from interface: RBitSet
        Set all bits to zero
        Specified by:
        clear in interface RBitSet
      • or

        public void or​(String... bitSetNames)
        Description copied from interface: RBitSet
        Executes OR operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        or in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • and

        public void and​(String... bitSetNames)
        Description copied from interface: RBitSet
        Executes AND operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        and in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • xor

        public void xor​(String... bitSetNames)
        Description copied from interface: RBitSet
        Executes XOR operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        xor in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • not

        public void not()
        Description copied from interface: RBitSet
        Executes NOT operation over all bits
        Specified by:
        not in interface RBitSet
      • lengthAsync

        public RFuture<Long> lengthAsync()
        Description copied from interface: RBitSetAsync
        Returns "logical size" = index of highest set bit plus one. Returns zero if there are no any set bit.
        Specified by:
        lengthAsync in interface RBitSetAsync
        Returns:
        "logical size" = index of highest set bit plus one
      • setAsync

        public RFuture<Void> setAsync​(long fromIndex,
                                      long toIndex,
                                      boolean value)
        Description copied from interface: RBitSetAsync
        Set all bits to value from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        value - true = 1, false = 0
        Returns:
        void
      • clearAsync

        public RFuture<Void> clearAsync​(long fromIndex,
                                        long toIndex)
        Description copied from interface: RBitSetAsync
        Set all bits to zero from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        clearAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        Returns:
        void
      • setAsync

        public RFuture<Void> setAsync​(BitSet bs)
        Description copied from interface: RBitSetAsync
        Copy bits state of source BitSet object to this object
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        bs - - BitSet source
        Returns:
        void
      • setAsync

        public RFuture<Void> setAsync​(long fromIndex,
                                      long toIndex)
        Description copied from interface: RBitSetAsync
        Set all bits to one from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        Returns:
        void
      • setAsync

        public RFuture<Boolean> setAsync​(long bitIndex)
        Description copied from interface: RBitSetAsync
        Set bit to one at specified bitIndex
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • clearAsync

        public RFuture<Boolean> clearAsync​(long bitIndex)
        Description copied from interface: RBitSetAsync
        Set bit to zero at specified bitIndex
        Specified by:
        clearAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • orAsync

        public RFuture<Void> orAsync​(String... bitSetNames)
        Description copied from interface: RBitSetAsync
        Executes OR operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        orAsync in interface RBitSetAsync
        Parameters:
        bitSetNames - - name of stored bitsets
        Returns:
        void
      • andAsync

        public RFuture<Void> andAsync​(String... bitSetNames)
        Description copied from interface: RBitSetAsync
        Executes AND operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        andAsync in interface RBitSetAsync
        Parameters:
        bitSetNames - - name of stored bitsets
        Returns:
        void
      • xorAsync

        public RFuture<Void> xorAsync​(String... bitSetNames)
        Description copied from interface: RBitSetAsync
        Executes XOR operation over this object and specified bitsets. Stores result into this object.
        Specified by:
        xorAsync in interface RBitSetAsync
        Parameters:
        bitSetNames - - name of stored bitsets
        Returns:
        void
      • expire

        public boolean expire​(long timeToLive,
                              TimeUnit timeUnit)
        Description copied from interface: RExpirable
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAsync

        public RFuture<Boolean> expireAsync​(long timeToLive,
                                            TimeUnit timeUnit)
        Description copied from interface: RExpirableAsync
        Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​(long timestamp)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expireAtAsync

        public RFuture<Boolean> expireAtAsync​(long timestamp)
        Description copied from interface: RExpirableAsync
        Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAtAsync in interface RExpirableAsync
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​(Date timestamp)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • expireAtAsync

        public RFuture<Boolean> expireAtAsync​(Date timestamp)
        Description copied from interface: RExpirableAsync
        Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAtAsync in interface RExpirableAsync
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        public boolean clearExpire()
        Description copied from interface: RExpirable
        Clear an expire timeout or expire date for object.
        Specified by:
        clearExpire in interface RExpirable
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • clearExpireAsync

        public RFuture<Boolean> clearExpireAsync()
        Description copied from interface: RExpirableAsync
        Clear an expire timeout or expire date for object in async mode. Object will not be deleted.
        Specified by:
        clearExpireAsync in interface RExpirableAsync
        Returns:
        true if the timeout was cleared and false if not
      • remainTimeToLive

        public long remainTimeToLive()
        Description copied from interface: RExpirable
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLive in interface RExpirable
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • remainTimeToLiveAsync

        public RFuture<Long> remainTimeToLiveAsync()
        Description copied from interface: RExpirableAsync
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLiveAsync in interface RExpirableAsync
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.