|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.info.LyBitSet
public final class LyBitSet
This class adds methods to be used on BitSets. It's not an extension of the standard class java.util.BitSet because this class is final. Its only purpose is to add convenient methods for testing properties and to hold further optimizations.
BitSet
Nested Class Summary | |
---|---|
static class |
LyBitSet.Type
|
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Constructor Summary | |
---|---|
LyBitSet(LyBitSet.Type type,
java.util.BitSet marks)
Constructor. |
|
LyBitSet(LyBitSet.Type type,
java.lang.String[] specificMarks)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
boolean |
equals(java.lang.Object object)
Compares the current BitSet and the given BitSet values. |
boolean |
get(int mark)
Gets the value of the bit with the specified index. |
java.util.BitSet |
getBitSet()
Gets the java BitSet reference. |
static int |
getCount(java.util.BitSet marks)
Gives the number of bits set in a given bitset. |
java.util.BitSet |
getGenericMarks()
Accessor to the generic marks attached to this instance. |
int |
getGenericMarksNumber()
Gets number of generic marks according to bitset type. |
int |
getMark(java.lang.String markName)
Gets mark index corresponding to the specific given mark name. |
int |
getMark(java.lang.String markName,
boolean add)
Gets mark index corresponding to the specific given mark name. |
java.lang.String |
getMarkName(int markIndex)
Get mark name corresponding to a given mark value. |
int |
getSize()
Gets the marks size. |
java.lang.String[] |
getSpecificMarks()
Accessor to the specific marks attached to this instance (presented as an array of strings). |
LyBitSet.Type |
getType()
Gets the BitSet type. |
static boolean |
match(java.util.BitSet marks,
java.util.BitSet testedMarks,
boolean matchAll)
Checks if given marks are set in a bitset. |
boolean |
match(java.util.BitSet testedMarks,
boolean matchAll)
Checks if given marks are set in the current bitset . |
void |
set(int mark)
Sets the bit at the specified index to true. |
java.util.BitSet |
setGenericMarks(java.util.BitSet marks)
Sets the specific marks attached to this instance (presented as an array of strings). |
java.util.BitSet |
setSpecificMarks(java.util.BitSet marks)
Sets the specific marks attached to this instance. |
java.util.BitSet |
setSpecificMarks(java.lang.String[] marks)
Sets the specific marks attached to this instance (presented as an array of strings). |
java.lang.String |
toString()
Returns a string representation of this bit set. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyBitSet(LyBitSet.Type type, java.util.BitSet marks)
_type
and _marks
with the given values.
type
- the BitSet typemarks
- the bit setpublic LyBitSet(LyBitSet.Type type, java.lang.String[] specificMarks)
_type
and _marks
with the given values.
type
- the BitSet typemarks
- the bit setMethod Detail |
---|
public static boolean match(java.util.BitSet marks, java.util.BitSet testedMarks, boolean matchAll)
marks
- The reference bitset.testedMarks
- A set of bits to check with the reference bitset.matchAll
- Indicates if all marks must match or not.
java.lang.IllegalArgumentException
- if the reference marks set is null or if the
testedMarks set is null or empty.public static int getCount(java.util.BitSet marks)
marks
- the bitset.
public LyBitSet.Type getType()
#Type.A_MARKS
#Type.C_MARKS
#Type.F_MARKS
#Type.FL_MARKS
public java.util.BitSet getBitSet()
public int getSize()
public boolean get(int mark)
mark
- the bit index
public void set(int mark)
mark
- the index of the bit to setpublic boolean match(java.util.BitSet testedMarks, boolean matchAll)
bitset
.
testedMarks
- the set of bits to check.matchAll
- Indicates if all marks must match or not.
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.InternalError
- if the super.clone() method throws a
CloneNotSupportedException.public java.lang.String toString()
BitSet drPepper = new BitSet();
Now drPepper.toString() returns "{}".
drPepper.set(2);
Now drPepper.toString() returns "{2}".
drPepper.set(4); drPepper.set(10);
Now drPepper.toString() returns "{2, 4, 10}".
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- object to compare to
public int getMark(java.lang.String markName, boolean add)
markName
- Name of the mark.add
- indicates if the.mark must be added if it doesn't exit
LyFieldInfo.getMarkName(int)
public int getMark(java.lang.String markName)
markName
- Name of the mark.
LyFieldInfo.getMarkName(int)
public java.lang.String getMarkName(int markIndex)
markIndex
- Mark value (index of a bit in a bits set).
public java.util.BitSet getGenericMarks()
public java.util.BitSet setGenericMarks(java.util.BitSet marks)
public java.lang.String[] getSpecificMarks()
public java.util.BitSet setSpecificMarks(java.lang.String[] marks)
public java.util.BitSet setSpecificMarks(java.util.BitSet marks)
public int getGenericMarksNumber()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |