public class myAttribute
extends java.lang.Object
Constructor and Description |
---|
myAttribute()
Creates an attribute with empty values that we can identify
|
myAttribute(myAttribute att)
Creates an attribute from another existing attribute
|
myAttribute(java.lang.String newname,
int type,
boolean newinput)
Creates an attribute with the name of the attribute, the data type of the attribute and whether the
attribute is input or output; the rest of the values are initialized with empty values that we can
identify.
|
myAttribute(java.lang.String newname,
int type,
double newmin,
double newmax,
boolean newinput)
Creates an attribute with the name of the attribute, the data type of the attribute, the minimum value
for the attribute, the maximum value for the attribute, the minimum value for the attribute and whether
the attribute is input or output; the rest of the values arte initialized with empty values that we can
identify.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Checks if an attribute is the same attribute as another object
|
int |
getAttributeType()
Gets the data type of the data of the attribute
|
double |
getMax()
Gets the maximum value for the attribute if it is not a nominal attribute
|
double |
getMin()
Gets the minimum value for the attribute if it is not a nominal attribute
|
java.lang.String |
getName()
Gets the name of the attribute
|
java.lang.String |
getValue(int j)
Gets the value of a nominal attribute from the position in the list of possible values
|
java.util.ArrayList<java.lang.String> |
getValues()
Gets an array of possible values if it is a nominal attribute
|
int |
hashCode()
Hash-code function for the class that is used when object is inserted in a structure like a hashtable
|
boolean |
isInput()
Answer if the attribute is an input attribute or not
|
boolean |
isNominal()
Answers if the attribute is nominal or not
|
void |
setAttributeType(int attributeType)
Replaces the data type of the data of the attribute with a new data type
|
void |
setInput(boolean input)
Changes the logical attribute stating if an attribute is input or not
|
void |
setMax(double max)
Replaces the maximum value for the attribute with a new maximum value
|
void |
setMin(double min)
Replaces the minimum value for the attribute with a new minimum value
|
void |
setName(java.lang.String name)
Replaces the name of the attribute with another new name
|
void |
setValue(java.lang.String newvalue,
int j)
Replaces the value in a position of a nominal attribute with a new value
|
void |
setValues(java.util.ArrayList<java.lang.String> values)
Replaces the array of possible values for the attribute data type with a new array of values
|
java.lang.String |
toString()
Overriden function that converts the class to a string
|
public myAttribute()
public myAttribute(java.lang.String newname, int type, boolean newinput)
newname
- The name of the attribute that is going to be createdtype
- The data type of the attribute that is going to be creatednewinput
- Whereas the attribute that is going to be created is input or outputpublic myAttribute(java.lang.String newname, int type, double newmin, double newmax, boolean newinput)
newname
- The name of the attribute that is going to be createdtype
- The data type of the attribute that is going to be creatednewmin
- The minimum value for the attribute that is going to be creatednewmax
- The maximum value for the attribute that is going to be creatednewinput
- Whereas the attribute that is going to be created is input or outputpublic myAttribute(myAttribute att)
att
- Original attribute from which we are going to create a copypublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object that is checked to see if it is the same attributeObject.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean isNominal()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- New name for the attributepublic int getAttributeType()
public void setAttributeType(int attributeType)
attributeType
- New data type of the data of the attributepublic double getMin()
public void setMin(double min)
min
- New minimum value for the attributepublic double getMax()
public void setMax(double max)
max
- New maximum value for the attributepublic java.util.ArrayList<java.lang.String> getValues()
public void setValues(java.util.ArrayList<java.lang.String> values)
values
- New array of possible values for the attributepublic java.lang.String getValue(int j)
j
- position of the value asked.public void setValue(java.lang.String newvalue, int j)
newvalue
- New value of a nominal attribute for the specified positionj
- Position of the value that is being replacedpublic boolean isInput()
public void setInput(boolean input)
input
- Logical value stating if an attribute is input or not