public class Bits extends Object
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
protected static class |
Bits.BitsState |
Modifier and Type | Field and Description |
---|---|
int[] |
bits |
protected Bits.BitsState |
currentState |
Modifier | Constructor and Description |
---|---|
|
Bits()
Construct an initially empty set.
|
|
Bits(Bits someBits) |
|
Bits(boolean reset) |
protected |
Bits(int[] bits,
Bits.BitsState initState)
Construct a set consisting initially of given bit vector.
|
Modifier and Type | Method and Description |
---|---|
Bits |
andSet(Bits xs)
this set = this set & xs.
|
Bits |
assign(Bits someBits) |
void |
clear()
This set = {}.
|
Bits |
diffSet(Bits xs)
this set = this set \ xs.
|
Bits |
dup()
Return a copy of this set.
|
protected int[] |
dupBits() |
void |
excl(int x)
Exclude x from this set.
|
void |
excludeFrom(int start)
Exclude [start...end] from this set.
|
void |
incl(int x)
Include x in this set.
|
void |
inclRange(int start,
int limit)
Include [start..limit) in this set.
|
protected void |
internalAndSet(Bits xs) |
protected void |
internalReset() |
boolean |
isMember(int x)
Is x an element of this set?
|
boolean |
isReset() |
static void |
main(String[] args)
Test Bits.nextBit(int).
|
int |
nextBit(int x)
Return the index of the least bit position ≥ x that is set.
|
Bits |
orSet(Bits xs)
this set = this set | xs.
|
void |
reset() |
protected void |
sizeTo(int len) |
String |
toString()
a string representation of this set.
|
Bits |
xorSet(Bits xs)
this set = this set ^ xs.
|
public int[] bits
protected Bits.BitsState currentState
public Bits()
public Bits(Bits someBits)
public Bits(boolean reset)
protected Bits(int[] bits, Bits.BitsState initState)
protected void sizeTo(int len)
public void clear()
public void reset()
protected void internalReset()
public boolean isReset()
public Bits dup()
protected int[] dupBits()
public void incl(int x)
public void inclRange(int start, int limit)
public void excludeFrom(int start)
public void excl(int x)
public boolean isMember(int x)
protected void internalAndSet(Bits xs)
public int nextBit(int x)
for (int i = bits.nextBit(0); i>=0; i = bits.nextBit(i+1)) ...
public String toString()
public static void main(String[] args)
Copyright © 2015. All rights reserved.