rdr.core
Class Attribute

java.lang.Object
  extended by rdr.core.Attribute
All Implemented Interfaces:
java.io.Serializable

public class Attribute
extends java.lang.Object
implements java.io.Serializable

An attribute of the domain model. Is essentially a name and type.

Author:
Ivan Bindoff
See Also:
Serialized Form

Constructor Summary
Attribute(java.lang.String name, int ty)
          Constructor for Attribute
Attribute(java.lang.String name, Type ty)
          Constructor.
 
Method Summary
 java.lang.String getName()
           
 java.lang.String[] getPotentialOperators()
          Returns all the operators that are valid for this attribute Returns an array of string, since it's intended for the JTables in the KnowledgeAcquisition GUI
 int getType()
          This returns the actual type code for this attribute.
 java.lang.String getTypeName()
          Gets a textual representation of the type of this object.
 Type getTypeObject()
          Returns the actual Type object for this attribute
 void setName(java.lang.String name)
          Gives the attribute a new, specified name.
 void setType(int ty)
          Sets the type of this attribute using the type code
 java.lang.String toString()
          Turns this attribute into a string representation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String name,
                 int ty)
Constructor for Attribute

Parameters:
name - the name of the attribute i.e. "age" or "sex"
ty - the type of the attribute i.e. Type.NOMINAL or Type.NUMERIC

Attribute

public Attribute(java.lang.String name,
                 Type ty)
Constructor.

Parameters:
name -
ty -
Method Detail

getName

public java.lang.String getName()
Returns:
the name of the this attribute

setName

public void setName(java.lang.String name)
Gives the attribute a new, specified name.

Parameters:
name - the name you would like the attribute to have

getType

public int getType()
This returns the actual type code for this attribute. To return the Type object, use getTypeObject()

Returns:
the code for the type of this attribute

getTypeObject

public Type getTypeObject()
Returns the actual Type object for this attribute

Returns:
the type of this attribute

getTypeName

public java.lang.String getTypeName()
Gets a textual representation of the type of this object.

Returns:
the string name of the type of this attribute

setType

public void setType(int ty)
Sets the type of this attribute using the type code

Parameters:
ty - the type code - i.e. Type.NOMINAL or Type.NUMERIC or others, see Type class.

toString

public java.lang.String toString()
Turns this attribute into a string representation

Overrides:
toString in class java.lang.Object
Returns:
the name of the attribute

getPotentialOperators

public java.lang.String[] getPotentialOperators()
Returns all the operators that are valid for this attribute Returns an array of string, since it's intended for the JTables in the KnowledgeAcquisition GUI

Returns:
String[]