public final class Attributes
extends java.lang.Object
Attributes
This class is a static class that, basically, contains a Vector of defined attributes in the train file. Although it keeps all the attributes, it divides them in two groups, the input attributes and the output attributes. It could be that, depending on the @inputs and @outputs defined in the train file, some of the attributes are not valid, so, their values are not loaded to the API dataset. Even in this case, the non-careful attributes information is mantained in this static class.Attribute
Constructor and Description |
---|
Attributes() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areAllDefinedAsOutputs(java.util.Vector outputNames)
This method checks if all the output names vector corresponds with
all the attributes in output vector.
|
static void |
clearAll()
clearAll
This method clears all the static members of the class.
|
static Attribute |
getAttribute(int pos)
It returns the attribute being int the position passed as an argument.
|
static Attribute |
getAttribute(java.lang.String _name)
It returns the attribute requested.
|
static Attribute[] |
getAttributes()
It does return an array with all attributes
|
static Attribute |
getInputAttribute(int pos)
It returns the input attribute being int the position passed as an argument.
|
static Attribute[] |
getInputAttributes()
It returns all the input attributes
|
static java.lang.String |
getInputAttributesHeader()
It returns a String with all the input attributes definition in keel
format.
|
static java.lang.String |
getInputHeader()
It returns an String with the @inputs in keel format.
|
static int |
getInputNumAttributes()
It return the number of input attributes in the API
|
static int |
getNumAttributes()
It return the total number of attributes in the API
|
static Attribute |
getOutputAttribute(int pos)
It returns the output attribute being int the position passed as an argument.
|
static Attribute[] |
getOutputAttributes()
It does return all the output attributes.
|
static java.lang.String |
getOutputAttributesHeader()
It does return a String with all the output attributes definition in keel
format.
|
static java.lang.String |
getOutputHeader()
It does return an String with the @outputs in keel format.
|
static int |
getOutputNumAttributes()
It return the number of output attributes in the API
|
static java.lang.String |
getRelationName()
It gets the relation name.
|
static Attribute |
getUndefinedAttribute(int pos)
It returns the undefined attribute being int the position passed as an argument.
|
static Attribute[] |
getUndefinedAttributes()
It does return all the undefined attributes
|
static java.lang.String |
getUndefinedAttributesHeader()
It does return a String with all the undefined attributes definition
in keel format.
|
static int |
getUndefinedNumAttributes()
It return the number of undefined attributes in the API
|
static boolean |
hasIntegerAttributes()
The function returns if there is any integer attribute.
|
static boolean |
hasMissingValues()
The function returns if there is any missing value
|
static boolean |
hasNominalAttributes()
The function returns if there is any nominal attribute
|
static boolean |
hasRealAttributes()
The function returns if there is any real attribute.
|
static void |
print()
It does print the attributes information
|
static boolean |
removeAttribute(boolean inputAtt,
int whichAtt)
It does remove an attribute.
|
static void |
setRelationName(java.lang.String rel)
It sets the relation name.
|
public static void clearAll()
public static boolean hasNominalAttributes()
public static boolean hasIntegerAttributes()
public static boolean hasRealAttributes()
public static boolean hasMissingValues()
public static Attribute getAttribute(java.lang.String _name)
_name
- is the name of the attribute.public static Attribute[] getAttributes()
public static Attribute getInputAttribute(int pos)
pos
- is the position of the attribute wanted.public static Attribute[] getInputAttributes()
public static java.lang.String getInputHeader()
public static java.lang.String getInputAttributesHeader()
public static Attribute[] getOutputAttributes()
public static Attribute getOutputAttribute(int pos)
pos
- is the position of the attribute wanted.public static java.lang.String getOutputHeader()
public static java.lang.String getOutputAttributesHeader()
public static Attribute getUndefinedAttribute(int pos)
pos
- is the position of the attribute wanted.public static Attribute[] getUndefinedAttributes()
public static java.lang.String getUndefinedAttributesHeader()
public static Attribute getAttribute(int pos)
pos
- is the position of the attribute wanted.public static int getNumAttributes()
public static int getInputNumAttributes()
public static int getOutputNumAttributes()
public static int getUndefinedNumAttributes()
public static boolean areAllDefinedAsOutputs(java.util.Vector outputNames)
outputNames
- is a vector with all output attribute names.public static void setRelationName(java.lang.String rel)
rel
- is the name to be set to the relationNamepublic static java.lang.String getRelationName()
public static boolean removeAttribute(boolean inputAtt, int whichAtt)
inputAtt
- is a boolean that indicates if the attribute to be removed
is an input attributewhichAtt
- is an integer that indicates the position of the attribute
to be removed.public static void print()