public final class ACQ_Scope
extends java.lang.Object
implements java.lang.Iterable<java.lang.Integer>
Modifier and Type | Field and Description |
---|---|
static ACQ_Scope |
EMPTY
Empty scope
|
private java.util.BitSet |
variables
BitSet structure is used to represent the variables of this scope.
|
Constructor and Description |
---|
ACQ_Scope()
Empty constructor, initialize this scope with an empty BitSet
|
ACQ_Scope(java.util.BitSet bs)
Constructor from a specified BitSet
|
ACQ_Scope(int... vars)
Constructor from an int array or from multiples int
|
ACQ_Scope(java.lang.Iterable<java.lang.Integer> iterable)
Constructor from an Iterable over Integer elements
|
ACQ_Scope(java.util.Spliterator<java.lang.Integer> iteratorVar)
Constructor from a Spliterator over Integer elements
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int var)
Checks if the specified variable (identified by a number) is contained in this scope
|
boolean |
containsAll(ACQ_Scope anotherSet)
Checks if the variables of the specified scope are all included in this scope
|
int |
getFirst()
Returns the index of the first bit that is set to true
|
int[] |
getProjection(ACQ_Query query)
*****TODO FIX THE SIZE OF THE RETURNED ARRAY*****
For a specified query, it returns the values of this query regarding this scope
|
int |
getSecond()
Returns the index of the second bit that is set to true
|
int |
getThird()
Returns the index of the third bit that is set to true
|
java.util.Iterator<java.lang.Integer> |
iterator()
Returns an iterator over the variables of this scope
|
int |
size()
Returns the amount of variable of this scope
|
ACQ_Scope[] |
split()
Split this scope into two new scopes.
|
java.util.Spliterator<java.lang.Integer> |
spliterator() |
java.lang.String |
toString() |
ACQ_Scope |
union(ACQ_Scope other)
Returns a new scope that contains both variables of this scope and the specified scope
|
public static ACQ_Scope EMPTY
private final java.util.BitSet variables
public ACQ_Scope()
public ACQ_Scope(java.lang.Iterable<java.lang.Integer> iterable)
iterable
- Iterable over Integer elementspublic ACQ_Scope(java.util.Spliterator<java.lang.Integer> iteratorVar)
iteratorVar
- Spliterator over Integer elementspublic ACQ_Scope(int... vars)
vars
- Arbitrary Number of Argumentspublic ACQ_Scope(java.util.BitSet bs)
bs
- BitSetpublic final int size()
public final int getFirst()
public final int getSecond()
public final int getThird()
public final boolean contains(int var)
var
- A variablepublic final boolean containsAll(ACQ_Scope anotherSet)
anotherSet
- Scope to check such as anotherSet is included in this scopepublic final ACQ_Scope union(ACQ_Scope other)
other
- Scopepublic final java.util.Iterator<java.lang.Integer> iterator()
iterator
in interface java.lang.Iterable<java.lang.Integer>
public java.util.Spliterator<java.lang.Integer> spliterator()
spliterator
in interface java.lang.Iterable<java.lang.Integer>
public ACQ_Scope[] split()
public java.lang.String toString()
toString
in class java.lang.Object
public int[] getProjection(ACQ_Query query)
query
- An example