org.redisson.api.RBitSetRx Maven / Gradle / Ivy
/**
* Copyright 2018 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.api;
import java.util.BitSet;
import io.reactivex.Flowable;
/**
* RxJava2 interface for BitSet object
*
* @author Nikita Koksharov
*
*/
public interface RBitSetRx extends RExpirableRx {
Flowable toByteArray();
/**
* Returns "logical size" = index of highest set bit plus one.
* Returns zero if there are no any set bit.
*
* @return "logical size" = index of highest set bit plus one
*/
Flowable length();
/**
* Set all bits to value
from fromIndex
(inclusive) to toIndex
(exclusive)
*
* @param fromIndex inclusive
* @param toIndex exclusive
* @param value true = 1, false = 0
* @return void
*
*/
Flowable set(long fromIndex, long toIndex, boolean value);
/**
* Set all bits to zero from fromIndex
(inclusive) to toIndex
(exclusive)
*
* @param fromIndex inclusive
* @param toIndex exclusive
* @return void
*
*/
Flowable clear(long fromIndex, long toIndex);
/**
* Copy bits state of source BitSet object to this object
*
* @param bs - BitSet source
* @return void
*/
Flowable set(BitSet bs);
/**
* Executes NOT operation over all bits
*
* @return void
*/
Flowable not();
/**
* Set all bits to one from fromIndex
(inclusive) to toIndex
(exclusive)
*
* @param fromIndex inclusive
* @param toIndex exclusive
* @return void
*/
Flowable set(long fromIndex, long toIndex);
/**
* Returns number of set bits.
*
* @return number of set bits.
*/
Flowable size();
/**
* Returns true
if bit set to one and false
overwise.
*
* @param bitIndex - index of bit
* @return true
if bit set to one and false
overwise.
*/
Flowable get(long bitIndex);
/**
* Set bit to one at specified bitIndex
*
* @param bitIndex - index of bit
* @return true
- if previous value was true,
* false
- if previous value was false
*/
Flowable set(long bitIndex);
/**
* Set bit to value
at specified bitIndex
*
* @param bitIndex - index of bit
* @param value true = 1, false = 0
* @return true
- if previous value was true,
* false
- if previous value was false
*/
Flowable set(long bitIndex, boolean value);
/**
* Returns the number of bits set to one.
*
* @return number of bits
*/
Flowable cardinality();
/**
* Set bit to zero at specified bitIndex
*
* @param bitIndex - index of bit
* @return true
- if previous value was true,
* false
- if previous value was false
*/
Flowable clear(long bitIndex);
/**
* Set all bits to zero
*
* @return void
*/
Flowable clear();
/**
* Executes OR operation over this object and specified bitsets.
* Stores result into this object.
*
* @param bitSetNames - name of stored bitsets
* @return void
*/
Flowable or(String... bitSetNames);
/**
* Executes AND operation over this object and specified bitsets.
* Stores result into this object.
*
* @param bitSetNames - name of stored bitsets
* @return void
*/
Flowable and(String... bitSetNames);
/**
* Executes XOR operation over this object and specified bitsets.
* Stores result into this object.
*
* @param bitSetNames - name of stored bitsets
* @return void
*/
Flowable xor(String... bitSetNames);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy