public class Mask
extends java.lang.Object
Representation of a mask over a MyDataset. It allows to select a given set of entries without changing the MyDataset. In fact, it acts as a multiplexer over the MyDataset's entries. It also provides a cursor over those elements.
Constructor and Description |
---|
Mask()
Constructor (Warning: only for arrays definition)
|
Mask(int size)
Constructs a Mask of a given length.
|
Mask(int size,
boolean initial)
Constructs a Mask of a given length
The cursor is set atBegin (that's a non valid position and it will be necessary a next() to reach the first active position).
|
Modifier and Type | Method and Description |
---|---|
Mask |
and(keel.Algorithms.Rule_Learning.PART.IncrementalMask im)
Returns the mask that it's the outcome of the bolean operation 'and' between this and a given mask.
|
Mask |
and(Mask m)
Returns the mask that it's the outcome of the bolean operation 'and' between this and a given mask.
|
void |
change(int i)
Changes the value of a given position (if it was activated, it is now deactivated and vicecersa).
|
Mask |
complement()
Returns a complementary mask of this mask
(the activated entries of this mask are deactivated and viceversa).
|
Mask |
copy()
Returns a copy of this Mask
|
void |
copyTo(Mask replicate)
Copies this Mask into another Mask
|
int |
getIndex()
Returns the position pointed by the cursors.
|
int |
getnActive()
Return the number of active entries
|
boolean |
isActive(int i)
Returns wether a given entry is active or not
|
boolean |
next()
Advances the cursor to the next active entry.
|
Mask |
or(keel.Algorithms.Rule_Learning.PART.IncrementalMask im)
Returns the mask that it's the outcome of the bolean operation 'or' between this and a given mask.
|
Mask |
or(Mask m)
Returns the mask that it's the outcome of the bolean operation 'or' between this and a given mask.
|
Mask |
or(Mask[] m)
Implements the 'or' whith other Masks
|
void |
reset()
Deactivates the entry pointed by the cursor
|
void |
reset(int i)
Deactivates the value of a given position.
|
void |
resetIndex()
Sets the cursor at atBegin
(that's a non valid position and it will be necessary a next() to reach the first active position).
|
void |
set(int i)
Activates the value of a given position.
|
void |
set(int i,
boolean value)
Sets the states (activated or deactivated) of a given position.
|
public Mask()
public Mask(int size)
size
- int the Mask's lengthpublic Mask(int size, boolean initial)
size
- int the Mask's lengthinitial
- boolean initial value of the all entriespublic Mask copy()
public void copyTo(Mask replicate)
replicate
- Mask a future copy of this Maskpublic void reset()
public void change(int i)
i
- int number of entry to changepublic void set(int i)
i
- int number of entry to activepublic boolean isActive(int i)
i
- int the index of the entrypublic void reset(int i)
i
- int number of entry to deactivepublic void set(int i, boolean value)
i
- int number of entry to setvalue
- boolean new value for the entrypublic Mask complement()
public Mask and(Mask m)
m
- Mask the other maskpublic Mask and(keel.Algorithms.Rule_Learning.PART.IncrementalMask im)
im
- IncrementalMask the other maskpublic Mask or(Mask m)
m
- Mask the other maskpublic Mask or(Mask[] m)
m
- Mask[] the other maskspublic Mask or(keel.Algorithms.Rule_Learning.PART.IncrementalMask im)
im
- IncremetalMask the other maskpublic int getnActive()
public boolean next()
public int getIndex()
public void resetIndex()