public class LBR.Indexes extends java.lang.Object implements java.io.Serializable, RevisionHandler
Enables a set of indexes to a given dataset to be created and used with an algorithm. This reduces the memory overheads and time required when manipulating and referencing Instances and their Attributes.
Modifier and Type | Field and Description |
---|---|
boolean[] |
m_AttIndexes
the array attribute indexes
|
int |
m_ClassIndex
the Class Index for the data set
|
boolean[] |
m_InstIndexes
the array instance indexes
|
int |
m_NumAttsSet
the number of attributes "in use" or set to a the original value (true or false)
|
int |
m_NumInstsSet
the number of instances "in use" or set to a the original value (true or false)
|
int |
m_NumSeqAttsSet
the number of sequential attributes "in use" or set to a the original value (true or false)
|
int |
m_NumSeqInstsSet
the number of sequential instances "in use" or set to a the original value (true or false)
|
int[] |
m_SequentialAttIndexes
an array of attribute indexes that are set to either true or false
|
int[] |
m_SequentialInstIndexes
the array of instance indexes that are set to a either true or false
|
Constructor and Description |
---|
Indexes(int numInstances,
int numAtts,
boolean value,
int classIndex)
constructor
|
Indexes(LBR.Indexes FromIndexes)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAttIndex(int index)
Returns the boolean value at the specified index in the Attribute Indexes array
|
boolean |
getInstanceIndex(int index)
Returns the boolean value at the specified index in the Instance Index array
|
int |
getNumAttributes()
Returns the number of attributes in the dataset
|
int |
getNumAttributesSet()
Returns the number of attributes "in use"
|
int |
getNumInstances()
Returns the number of instances in the dataset
|
int |
getNumInstancesSet()
Returns the number of instances "in use"
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSequentialAttIndex(int index)
Returns the boolean value at the specified index in the Sequential Attribute Indexes array
|
int |
getSequentialInstanceIndex(int index)
Returns the boolean value at the specified index in the Sequential Instance Indexes array
|
int |
getSequentialNumAttributes()
Returns the number of attributes in the Sequential array
|
int |
getSequentialNumInstances()
Returns the number of instances in the Sequential array
|
boolean |
isSequentialAttIndexValid()
Returns whether or not the Sequential Attribute Index requires rebuilding due to a change
|
boolean |
isSequentialInstanceIndexValid()
Returns whether or not the Sequential Instance Index requires rebuilding due to a change
|
void |
resetAttIndex(boolean value)
Resets the boolean value in AttIndexes array
|
void |
resetAttIndexTo(LBR.Indexes FromIndexes)
Resets the boolean value in AttIndexes array based on another set of Indexes
|
void |
resetDatasetBasedOn(LBR.Indexes FromIndexes)
Resets the boolean values in Attribute and Instance array to reflect an empty dataset withthe same attributes set as in the incoming Indexes Object
|
void |
resetInstanceIndex(boolean value)
Resets the boolean value in the Instance Indexes array to a specified value
|
void |
setAttIndex(int index,
boolean value)
Changes the boolean value at the specified index in the AttIndexes array
|
void |
setAtts(int[] Attributes,
boolean value)
Changes the boolean value at the specified index in the InstIndexes array
|
void |
setInstanceIndex(int index,
boolean value)
Changes the boolean value at the specified index in the InstIndexes array
|
void |
setInsts(int[] Instances,
boolean value)
Changes the boolean value at the specified index in the InstIndexes array
|
void |
setSequentialAttIndex(boolean value)
A Sequential Attribute index is all those Attributes that are set to the specified value placed in a sequential array.
|
void |
setSequentialDataset(boolean value)
Sets both the Instance and Attribute indexes to a specified value
|
void |
setSequentialInstanceIndex(boolean value)
A Sequential Instance index is all those Instances that are set to the specified value placed in a sequential array.
|
public boolean[] m_InstIndexes
public boolean[] m_AttIndexes
public int[] m_SequentialInstIndexes
public int[] m_SequentialAttIndexes
public int m_NumInstsSet
public int m_NumAttsSet
public int m_NumSeqInstsSet
public int m_NumSeqAttsSet
public int m_ClassIndex
public Indexes(int numInstances, int numAtts, boolean value, int classIndex)
numInstances
- the number of instances in datasetnumAtts
- the number of attributes in datasetvalue
- either true or falseclassIndex
- Set to -1 if you want class attribute switched on or the value of the instances
class index will be switched of and the class attibute will not be considered.public Indexes(LBR.Indexes FromIndexes)
FromIndexes
- the object you want to copypublic void setInstanceIndex(int index, boolean value)
index
- the index of the instancevalue
- the value to set at the specified indexpublic void setAtts(int[] Attributes, boolean value)
Attributes
- array of attributesvalue
- the value to set at the specified indexpublic void setInsts(int[] Instances, boolean value)
Instances
- array of instancesvalue
- the value to set at the specified indexpublic void setAttIndex(int index, boolean value)
index
- the index of the instancevalue
- the value to set at the specified indexpublic boolean getInstanceIndex(int index)
index
- the index of the instancepublic int getSequentialInstanceIndex(int index)
index
- the index of the instancepublic void resetInstanceIndex(boolean value)
value
- the value to set all indexespublic void resetDatasetBasedOn(LBR.Indexes FromIndexes)
FromIndexes
- the Indexes to be copiedpublic void resetAttIndex(boolean value)
value
- the value to set the attributes topublic void resetAttIndexTo(LBR.Indexes FromIndexes)
FromIndexes
- the Indexes to be copiedpublic boolean getAttIndex(int index)
index
- the index of the Instancepublic int getSequentialAttIndex(int index)
index
- the index of the Attributepublic int getNumInstancesSet()
public int getNumInstances()
public int getSequentialNumInstances()
public int getNumAttributes()
public int getNumAttributesSet()
public int getSequentialNumAttributes()
public boolean isSequentialInstanceIndexValid()
public boolean isSequentialAttIndexValid()
public void setSequentialDataset(boolean value)
value
- the value for the Instance and Attribute indicespublic void setSequentialInstanceIndex(boolean value)
value
- the sequential instance indexpublic void setSequentialAttIndex(boolean value)
value
- the sequential attribute indexpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler