|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.liacs.subdisc.Column
public class Column
A Column contains all data from a column read from a File
or
database. Its members store some of the important characteristics of the
Column. A Column is identified by its [@link Attribute Attribute}. One
important member stores the value for data that was missing (having a value
of '?') in the original data. See AttributeType
for the
default values for the various AttributeTypes.
Field Summary | |
---|---|
static int |
DEFAULT_INIT_SIZE
|
Constructor Summary | |
---|---|
Column(org.w3c.dom.Node theColumnNode)
|
|
Column(java.lang.String theName,
java.lang.String theShort,
AttributeType theType,
int theIndex,
int theNrRows)
|
Method Summary | |
---|---|
void |
add(boolean theBinary)
|
void |
add(float theFloat)
|
void |
add(java.lang.String theNominal)
|
void |
addNodeTo(org.w3c.dom.Node theParentNode)
Creates an XMLNode representation of this Column. |
Column |
copy()
|
java.util.BitSet |
getBinaries()
|
boolean |
getBinary(int theIndex)
|
int |
getCardinality()
Counts the number of distinct values, or cardinality, for this Column. |
java.util.TreeSet<java.lang.String> |
getDomain()
|
float |
getFloat(int theIndex)
|
boolean |
getHasMissingValues()
Returns whether this Column is has missing values or not. |
int |
getIndex()
|
boolean |
getIsEnabled()
Returns whether this Column is enabled. |
float |
getMax()
|
float |
getMin()
|
java.util.BitSet |
getMissing()
Returns a copy of a BitSet representing the missing values for this Column. |
java.lang.String |
getMissingValue()
Retrieves the value currently set for all missing values. |
java.lang.String |
getName()
|
java.lang.String |
getNameAndShort()
|
java.lang.String |
getNominal(int theIndex)
|
java.lang.String |
getShort()
|
java.lang.String |
getString(int theIndex)
|
AttributeType |
getType()
|
boolean |
hasShort()
|
boolean |
isBinaryType()
|
boolean |
isNominalType()
|
boolean |
isNumericType()
|
boolean |
isOrdinalType()
|
void |
permute(int[] thePermutation)
|
void |
print()
|
Column |
select(java.util.BitSet theSet)
Creates a copy of the current column with some records removed. |
void |
set(int theIndex,
float theValue)
|
void |
setIsEnabled(boolean theSetting)
Set whether this Column is enabled. |
void |
setMissing(int theIndex)
Sets the bit at the specified position in the itsMissing BisSet. |
boolean |
setNewMissingValue(java.lang.String theNewValue)
Sets the new missing value for this Column. |
boolean |
setType(AttributeType theAttributeType)
Sets a new type for this Column. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_INIT_SIZE
Constructor Detail |
---|
public Column(java.lang.String theName, java.lang.String theShort, AttributeType theType, int theIndex, int theNrRows)
public Column(org.w3c.dom.Node theColumnNode)
theColumnNode
- Method Detail |
---|
public Column select(java.util.BitSet theSet)
theSet
- public void add(java.lang.String theNominal)
public void add(float theFloat)
public void add(boolean theBinary)
public void set(int theIndex, float theValue)
public int size()
public java.lang.String getName()
public java.lang.String getShort()
public boolean hasShort()
public java.lang.String getNameAndShort()
public AttributeType getType()
public int getIndex()
public java.lang.String getNominal(int theIndex)
public float getFloat(int theIndex)
public boolean getBinary(int theIndex)
public java.lang.String getString(int theIndex)
public java.util.BitSet getBinaries()
public boolean isNominalType()
public boolean isNumericType()
public boolean isOrdinalType()
public boolean isBinaryType()
public float getMin()
public float getMax()
public void permute(int[] thePermutation)
public void print()
public java.util.TreeSet<java.lang.String> getDomain()
public boolean setType(AttributeType theAttributeType)
AttributeType
of this Column.
theAttributeType
- a valid AttributeType.
true
if the change was successful,
false
otherwise.public boolean getIsEnabled()
true
if this Column is enabled, false
otherwise.public void setIsEnabled(boolean theSetting)
theSetting
- use true
to enable this Column, and
false
to disable it.public boolean getHasMissingValues()
true
if this Column has missing values
false
otherwise.public java.util.BitSet getMissing()
setMissing
to set missing values. Editing
on the BitSet retrieved through getMissing
has no effect on
the original missing values BitSet.
public void setMissing(int theIndex)
theIndex
- the bit to set in the itsMissing BitSet.public java.lang.String getMissingValue()
public boolean setNewMissingValue(java.lang.String theNewValue)
theNewValue
- the value to use as new missing value.
true
if setting the new missing value is successful,
false
otherwise.public int getCardinality()
0
when this Column
contains no data.public void addNodeTo(org.w3c.dom.Node theParentNode)
XMLNode
representation of this Column.
Note: the value for missing values is included as missing_value. When
data is loaded, '?' values are replaced by missing_value by the
appropriate FileLoader.
addNodeTo
in interface XMLNodeInterface
theParentNode
- the Node of which this Node will be a ChildNode.
// * @return a Node that contains all the information of this column.public Column copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |