Class BitFlags
- java.lang.Object
-
- com.biglybt.core.peermanager.piecepicker.util.BitFlags
-
- All Implemented Interfaces:
java.lang.Cloneable
public class BitFlags extends java.lang.Object implements java.lang.Cloneable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitFlags
and(BitFlags other)
Experimental.void
clear()
java.lang.Object
clone()
boolean
equals(java.lang.Object o)
int
hashCode()
void
set(int i)
for setting a flag that is not known to be the first or last, or notvoid
setAll()
void
setEnd(int i)
this is for setting a flag that is already known to be the last true flagvoid
setOnly(int i)
clears the array then sets the given flagvoid
setStart(int i)
for setting a flag that is already known to be the first true flagint
size()
You can read flags.length instead (but please don't modify it)void
unset(int i)
for setting a flag that is not known to be the first or last, or not
-
-
-
Constructor Detail
-
BitFlags
public BitFlags(int count)
-
BitFlags
public BitFlags(boolean[] _flags)
-
BitFlags
public BitFlags(BitFlags other)
clone constructor
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
size
public int size()
You can read flags.length instead (but please don't modify it)- Returns:
- the number of elements in this array
-
clear
public void clear()
-
setStart
public void setStart(int i)
for setting a flag that is already known to be the first true flag
-
set
public void set(int i)
for setting a flag that is not known to be the first or last, or not
-
unset
public void unset(int i)
for setting a flag that is not known to be the first or last, or not
-
setEnd
public void setEnd(int i)
this is for setting a flag that is already known to be the last true flag
-
setOnly
public void setOnly(int i)
clears the array then sets the given flag
-
setAll
public void setAll()
-
and
public BitFlags and(BitFlags other)
Experimental. Returns a new BitFlags with flags set as the logical AND of both BitFlags. The length of both must be the same.- Parameters:
other
- BitFlags to be ANDed with this BitFlags. Must not be null.- Returns:
- new BitFlags representing the logical AND of the two
-
-