nl.liacs.subdisc
Class Attribute

java.lang.Object
  extended by nl.liacs.subdisc.Attribute
All Implemented Interfaces:
XMLNodeInterface

public class Attribute
extends java.lang.Object
implements XMLNodeInterface

Each Column in a Table is identified by its Attribute. Attributes can be used as PrimaryTarget or SecondaryTarget, but only when the AttributeType of the Attribute is appropriate for the TargetConcepts TargetType. All Attribute constructors and setters ensure that its AttributeType is never null (NOMINAL by default).


Nested Class Summary
static class Attribute.AttributeType
          There is only a limited number of AttributeTypes an Attribute can have.
 
Constructor Summary
Attribute(org.w3c.dom.Node theAttributeNode)
          Create an Attribute from an XML AttributeNode.
Attribute(java.lang.String theName, java.lang.String theShort, Attribute.AttributeType theType)
           
Attribute(java.lang.String theName, java.lang.String theShort, Attribute.AttributeType theType, int theIndex)
           
 
Method Summary
 void addNodeTo(org.w3c.dom.Node theParentNode)
          Creates an XMLNode representation of this Attribute.
 int getIndex()
           
 java.lang.String getName()
           
 java.lang.String getNameAndShort()
           
 java.lang.String getNameOrShort()
           
 java.lang.String getShort()
           
 Attribute.AttributeType getType()
           
 java.lang.String getTypeName()
           
 boolean hasShort()
           
 boolean isBinaryType()
           
 boolean isNominalType()
           
 boolean isNumericType()
           
 boolean isOrdinalType()
           
 void print()
           
 boolean setType(Attribute.AttributeType theType)
          Sets the AttributeType for this Attribute.
 Attribute.AttributeType setType(java.lang.String theType)
          Sets the AttributeType for this Attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String theName,
                 java.lang.String theShort,
                 Attribute.AttributeType theType,
                 int theIndex)

Attribute

public Attribute(java.lang.String theName,
                 java.lang.String theShort,
                 Attribute.AttributeType theType)

Attribute

public Attribute(org.w3c.dom.Node theAttributeNode)
Create an Attribute from an XML AttributeNode.

Method Detail

getIndex

public int getIndex()

getType

public Attribute.AttributeType getType()

getName

public java.lang.String getName()

getShort

public java.lang.String getShort()

hasShort

public boolean hasShort()

getNameAndShort

public java.lang.String getNameAndShort()

getNameOrShort

public java.lang.String getNameOrShort()

getTypeName

public java.lang.String getTypeName()

print

public void print()

isNominalType

public boolean isNominalType()

isNumericType

public boolean isNumericType()

isOrdinalType

public boolean isOrdinalType()

isBinaryType

public boolean isBinaryType()

setType

public Attribute.AttributeType setType(java.lang.String theType)
Sets the AttributeType for this Attribute. This is used for changing the AttributeType of a Column. The Column is responsible for checking whether its AttributeType can be changed to this new AttributeType. This method is case insensitive.

Parameters:
theType - the String representation of an valid AttributeType to set as this Attributes' new AttributeType.
Returns:
the new AttributeType, or the default AttributeType.NOMINAL if the String passed in as a parameter can not be resolved to a valid AttributeType.

setType

public boolean setType(Attribute.AttributeType theType)
Sets the AttributeType for this Attribute. This is used for changing the AttributeType of a Column. The Column is responsible for checking whether its AttributeType can be changed to this new AttributeType.

Parameters:
theType - the AttibuteType to set as this Attributes' new AttributeType.
Returns:
false if the AttributeType passed in as a parameter is null, true otherwise.

addNodeTo

public void addNodeTo(org.w3c.dom.Node theParentNode)
Creates an XMLNode representation of this Attribute.

Specified by:
addNodeTo in interface XMLNodeInterface
Parameters:
theParentNode - the Node of which this Node will be a ChildNode. // * @return a Node that contains all the information of this Attribute.