MCPcopy Create free account
hub / github.com/LFYSec/MScan / IBitSet

Interface IBitSet

src/main/java/pascal/taie/util/collection/IBitSet.java:41–373  ·  view source on GitHub ↗

Interface for different bit set implementations. This interface is similar to java.util.Set. The main motivation to reinvent a bit set is that the APIs of java.util.Set do not fulfill the requirements of program analysis. For APIs that may modify a bit set, such {@link #set(i

Source from the content-addressed store, hash-verified

39 * useful operations that are absent in {@link java.util.Set}.
40 */
41public interface IBitSet extends Copyable<IBitSet>, Serializable {
42
43 // ------------------------------------------------------------------------
44 // single-bit operations
45 // ------------------------------------------------------------------------
46
47 /**
48 * Sets the bit at the specified index to {@code true}.
49 *
50 * @param bitIndex a bit index
51 * @return {@code true} if this BitSet changed as a result of the call
52 * @throws IndexOutOfBoundsException if the specified index is negative
53 */
54 boolean set(int bitIndex);
55
56 /**
57 * Sets the bit at the specified index to the specified value.
58 *
59 * @param bitIndex a bit index
60 * @param value a boolean value to set
61 * @return {@code true} if this BitSet changed as a result of the call
62 * @throws IndexOutOfBoundsException if the specified index is negative
63 */
64 boolean set(int bitIndex, boolean value);
65
66 /**
67 * Sets the bit specified by the index to {@code false}.
68 *
69 * @param bitIndex the index of the bit to be cleared
70 * @return {@code true} if this BitSet changed as a result of the call
71 * @throws IndexOutOfBoundsException if the specified index is negative
72 */
73 boolean clear(int bitIndex);
74
75 /**
76 * Returns the value of the bit with the specified index. The value
77 * is {@code true} if the bit with the index {@code bitIndex}
78 * is currently set in this {@code BitSet}; otherwise, the result
79 * is {@code false}.
80 *
81 * @param bitIndex the bit index
82 * @return the value of the bit with the specified index
83 * @throws IndexOutOfBoundsException if the specified index is negative
84 */
85 boolean get(int bitIndex);
86
87 /**
88 * Sets the bit at the specified index to the complement of its
89 * current value. This operation must modify the BitSet.
90 *
91 * @param bitIndex the index of the bit to flip
92 * @throws IndexOutOfBoundsException if the specified index is negative
93 */
94 void flip(int bitIndex);
95
96 /**
97 * Returns the index of the first bit that is set to {@code true}
98 * that occurs on or after the specified starting index. If no such

Callers 132

testMethod · 0.95
testRandomOrMethod · 0.95
testCopyMethod · 0.95
randomMultiEntryMethod · 0.95
testSerializableMethod · 0.95
build.gradle.ktsFile · 0.65
testClearMethod · 0.95
testIntersectsMethod · 0.95
testContains3Method · 0.95
testClearOrMethod · 0.95

Implementers 1

AbstractBitSetsrc/main/java/pascal/taie/util/collect

Calls

no outgoing calls

Tested by

no test coverage detected