edu.udo.cs.miningmart.m4.core
Class BaseAttribute

java.lang.Object
  extended byedu.udo.cs.miningmart.m4.core.M4Object
      extended byedu.udo.cs.miningmart.m4.core.M4Data
          extended byedu.udo.cs.miningmart.m4.core.GraphicalM4Object
              extended byedu.udo.cs.miningmart.m4.core.ParameterObject
                  extended byedu.udo.cs.miningmart.m4.core.Feature
                      extended byedu.udo.cs.miningmart.m4.core.BaseAttribute
All Implemented Interfaces:
BaseAttribute, java.lang.Comparable, Feature, GraphicalM4Object, M4Data, M4Object, M4Table, ParameterObject, java.io.Serializable, XmlInfo

public class BaseAttribute
extends Feature
implements XmlInfo, BaseAttribute

This class represents a BaseAttribute. It is a subclass of Feature.

Version:
$Id: BaseAttribute.java,v 1.5 2006/04/11 14:10:14 euler Exp $
Author:
Martin Scholz
See Also:
Feature, M4Data, Serialized Form

Field Summary
static java.lang.String ATTRIB_BA_CON_BAID
          The BaseAttribute ID of the BaseAttribute to Concept cross-table
static java.lang.String ATTRIB_BA_CON_CONID
          The Concept ID attribute of the BaseAttribute to Concept cross-table
static java.lang.String ATTRIB_BA_CON_TUPLE_ID
          The primary key attribute of the BaseAttribute to Concept cross-table
static java.lang.String ATTRIB_BASEATTRIBUTE_CONCEPTUAL_DT
          db level: the attribute for the base attribute's conceptual datatype number
static java.lang.String ATTRIB_BASEATTRIBUTE_ID
          db level: the attribute for the base attribute's IDs
static java.lang.String ATTRIB_BASEATTRIBUTE_MCF_ID
          db level: the attribute specifying the ID of the embedding MultiColumnFeature or NULL
static java.lang.String ATTRIB_BASEATTRIBUTE_NAME
          db level: the attribute for the base attribute's names
static java.lang.String ATTRIB_BASEATTRIBUTE_RELEVANCE
          db level: the attribute for the base attribute's relevance (unused)
static java.lang.String ATTRIB_BASEATTRIBUTE_TYPE
          db level: the attribute for the base attribute's type (db or mining)
static java.lang.String M4_TABLE_BA_CON
          The name of the BaseAttribute to Concept cross-table
static java.lang.String M4_TABLE_NAME
          The name of the M4 table representing base attributes
static M4Info m4Info
          Cache for getM4Info()
 
Fields inherited from class edu.udo.cs.miningmart.m4.core.GraphicalM4Object
graph2coord
 
Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Data
myDocumentation
 
Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Object
myId, myName
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo
M4_XML_VERSION, TAG_COLLECTION, TAG_DOUBLE, TAG_INTEGER, TAG_LONG, TAG_M4_ID, TAG_SHORT, TAG_STRING, TAG_XML_ID
 
Fields inherited from interface edu.udo.cs.miningmart.m4.BaseAttribute
TYPE_BASE, TYPE_DB, TYPE_MINING
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.M4Table
NOT_NULL
 
Constructor Summary
BaseAttribute(DB m4Db)
           
 
Method Summary
 void addColumn(Column column)
          Add a column to this BaseAttribute's columns.
 BaseAttribute copy()
          Makes a copy of this BaseAttribute.
 Feature copy(Concept newConcept)
          Create a copy of this BaseAttribute and connect it to the given Concept.
 Column createColumn(java.lang.String name)
          Create a Column with the given name and add it to this BaseAttribute's columns.
protected  void deleteLocal()
          Overwrites the superclass method to ensure that the cross table entries are deleted first
 Column getColumn(int index)
          Get a specific column that belongs to this BaseAttribute.
 java.util.Collection getColumns()
           
 long getConceptualDataType()
           
 java.lang.String getConceptualDataTypeName()
           
 Column getCurrentColumn()
          This method replaces "getColumnForColumnSet".
 java.lang.String getDBAttribS()
          Getter for the DB Attribute property
 java.util.Collection getDependentObjects()
          This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized.
 java.lang.String getIdAttributeName()
           
 M4Info getM4Info()
           
 java.lang.String getM4TableName()
           
 MultiColumnFeature getMCFeature()
          If this BaseAttribute belongs to a MultiColumnFeature, get it here.
 java.lang.String getRelevantS()
           
 java.lang.String getType()
           
 M4Info getXmlInfo()
           
 boolean hasColumn(Column col)
           
 boolean hasColumns()
           
 boolean isDBAttrib()
           
 boolean isDeselected()
           
 boolean isRelationallyValid()
          This method returns information about the relational validity of the object.
 boolean isRelevant()
           
 void primitiveSetMCFeature(MultiColumnFeature mcf)
          Primitive setter, do not use.
 void print()
          Method to print data about this M4Object.
protected  void readFromDbLocal()
          Reads this object's Concept from a cross-table at loading time.
protected  void removeAllM4References()
          This method needs to be implemented by all M4Data objects.
 boolean removeColumn(Column column)
          Remove a column from this BaseAttribute's columns.
 void removeLinkToColumns()
          Removes the link between this feature and all of its columns.
 void setColumns(java.util.Collection theColumns)
          Set all columns of this BaseAttribute.
 void setConceptualDataType(long type)
          Set the conceptual data type.
 void setConceptualDataTypeName(java.lang.String dtname)
          Set the name of the conceptual data type.
 void setDBAttrib(boolean a)
          Setter for DBAttrib.
 void setDBAttribS(java.lang.String attrib)
          Setter for DBAttrib.
 void setMCFeature(MultiColumnFeature mcf)
          If this BaseAttribute belongs to a MultiColumnFeature, set it here.
 void setName(java.lang.String name)
          Do not use spaces in BaseAttribute names, because these names are also used at the DB level for Column names.
 void setRelevant(boolean r)
          Set the relevance of this BaseAttribute.
 void setRelevantS(java.lang.String r)
          Set the relevance of this BaseAttribute.
 void setType(java.lang.String type)
          The type of the BaseAttribute
protected  void storeLocal()
          This method stores the pseudo foreign key reference to this objects's Concept, which is still realized by a cross-table (BA_CONCEPT_T).
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.Feature
correspondsTo, getConcept, getObjectsInNamespace, getParameterWhereThisIsOutputFeature, hasCoordinates, primitiveSetConcept, setConcept
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.ParameterObject
addParameterReference, getParameterReferences, removeParameterReference
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.GraphicalM4Object
deleteSoon, getCoordinates, getPoint, primitiveSetCoordinates, setCoordinatesDirty, setPoint
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data
exportLocal, genericGetter, genericSetter, getDocumentation, getObjectsReferencingMe, getObjectsReferencingMe, getObjectTag, getValidName, getXmlIdTag, getXmlVersion, hasDeleteStatus, importLocal, isDirty, isWaitingForDelete, primitiveGetDocObject, primitiveSetDocObject, readFromDb, removeDocObject, removeFromDb, removeSetFromDb, setDirty, setDocumentation, setId, updateObjectsFromTable
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Object
compareTo, doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, putM4ObjectToCache, replaceSpacesInName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo
doPrint, doPrint, exportLocal, genericGetter, genericSetter, getObjectTag, getXmlIdTag, getXmlVersion, importLocal
 
Methods inherited from interface edu.udo.cs.miningmart.m4.Feature
correspondsTo, getConcept, getParameterWhereThisIsOutputFeature, setConcept
 
Methods inherited from interface edu.udo.cs.miningmart.m4.ParameterObject
addParameterReference, getParameterReferences, removeParameterReference
 
Methods inherited from interface edu.udo.cs.miningmart.m4.GraphicalM4Object
getPoint, setPoint
 
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Data
deleteSoon, getDocumentation, getValidName, isDirty, isWaitingForDelete, setDocumentation
 
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Object
doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, putM4ObjectToCache, replaceSpacesInName, setId
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
The name of the M4 table representing base attributes

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_ID

public static final java.lang.String ATTRIB_BASEATTRIBUTE_ID
db level: the attribute for the base attribute's IDs

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_NAME

public static final java.lang.String ATTRIB_BASEATTRIBUTE_NAME
db level: the attribute for the base attribute's names

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_CONCEPTUAL_DT

public static final java.lang.String ATTRIB_BASEATTRIBUTE_CONCEPTUAL_DT
db level: the attribute for the base attribute's conceptual datatype number

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_RELEVANCE

public static final java.lang.String ATTRIB_BASEATTRIBUTE_RELEVANCE
db level: the attribute for the base attribute's relevance (unused)

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_TYPE

public static final java.lang.String ATTRIB_BASEATTRIBUTE_TYPE
db level: the attribute for the base attribute's type (db or mining)

See Also:
Constant Field Values

ATTRIB_BASEATTRIBUTE_MCF_ID

public static final java.lang.String ATTRIB_BASEATTRIBUTE_MCF_ID
db level: the attribute specifying the ID of the embedding MultiColumnFeature or NULL

See Also:
Constant Field Values

M4_TABLE_BA_CON

public static final java.lang.String M4_TABLE_BA_CON
The name of the BaseAttribute to Concept cross-table

See Also:
Constant Field Values

ATTRIB_BA_CON_TUPLE_ID

public static final java.lang.String ATTRIB_BA_CON_TUPLE_ID
The primary key attribute of the BaseAttribute to Concept cross-table

See Also:
Constant Field Values

ATTRIB_BA_CON_CONID

public static final java.lang.String ATTRIB_BA_CON_CONID
The Concept ID attribute of the BaseAttribute to Concept cross-table

See Also:
Constant Field Values

ATTRIB_BA_CON_BAID

public static final java.lang.String ATTRIB_BA_CON_BAID
The BaseAttribute ID of the BaseAttribute to Concept cross-table

See Also:
Constant Field Values

m4Info

public static M4Info m4Info
Cache for getM4Info()

Constructor Detail

BaseAttribute

public BaseAttribute(DB m4Db)
See Also:
edu.udo.cs.miningmart.m4.core.M4Data#Constructor
Method Detail

getM4TableName

public java.lang.String getM4TableName()
Specified by:
getM4TableName in interface M4Table
See Also:
M4Table.getM4TableName()

getIdAttributeName

public java.lang.String getIdAttributeName()
Specified by:
getIdAttributeName in interface M4Table
See Also:
M4Table.getIdAttributeName()

getM4Info

public M4Info getM4Info()
Specified by:
getM4Info in interface M4Table
See Also:
M4Table.getM4Info()

getXmlInfo

public M4Info getXmlInfo()
Specified by:
getXmlInfo in interface XmlInfo
Returns:
a M4Info object with the information of all XML fields of this object.
See Also:
XmlInfo.getXmlInfo()

print

public void print()
Description copied from interface: M4Object
Method to print data about this M4Object.

Specified by:
print in interface M4Object
Overrides:
print in class GraphicalM4Object
See Also:
Parameter.print()

setName

public void setName(java.lang.String name)
Do not use spaces in BaseAttribute names, because these names are also used at the DB level for Column names.

Specified by:
setName in interface M4Object
Overrides:
setName in class GraphicalM4Object
Parameters:
name - the new name to be set
See Also:
M4Object.setName(String)

copy

public BaseAttribute copy()
                   throws M4Exception
Makes a copy of this BaseAttribute.

Specified by:
copy in interface BaseAttribute
Returns:
A clone of this BaseAttribute, but with Id 0 since it is not written into the database yet.
Throws:
M4Exception

copy

public Feature copy(Concept newConcept)
             throws M4Exception
Create a copy of this BaseAttribute and connect it to the given Concept.

Specified by:
copy in interface Feature
Parameters:
newConcept - the concept to add the copy of this BaseAttribute to
Returns:
a copy of this BaseAttribute; the copy is connected to the given Concept
Throws:
M4Exception

addColumn

public void addColumn(Column column)
               throws M4Exception
Add a column to this BaseAttribute's columns.

Specified by:
addColumn in interface BaseAttribute
Throws:
M4Exception

createColumn

public Column createColumn(java.lang.String name)
                    throws M4Exception
Create a Column with the given name and add it to this BaseAttribute's columns.

Specified by:
createColumn in interface BaseAttribute
Parameters:
name - name for the Column
Returns:
the Columm
Throws:
M4Exception

hasColumn

public boolean hasColumn(Column col)
                  throws M4Exception
Specified by:
hasColumn in interface BaseAttribute
Parameters:
col - a Column
Returns:
true if a column with the same ID is already linked to this BaseAttribute
Throws:
M4Exception

hasColumns

public boolean hasColumns()
                   throws M4Exception
Specified by:
hasColumns in interface BaseAttribute
Returns:
true if at least one column is linked to this BaseAttribute
Throws:
M4Exception

removeColumn

public boolean removeColumn(Column column)
                     throws M4Exception
Remove a column from this BaseAttribute's columns.

Specified by:
removeColumn in interface BaseAttribute
Returns:
true if removing succeeded
Throws:
M4Exception

removeLinkToColumns

public void removeLinkToColumns()
                         throws M4Exception
Description copied from interface: Feature
Removes the link between this feature and all of its columns. This is needed to disconnect the conceptual and relational level.

Specified by:
removeLinkToColumns in interface Feature
Throws:
M4Exception

setConceptualDataType

public void setConceptualDataType(long type)
Set the conceptual data type.

Specified by:
setConceptualDataType in interface BaseAttribute
Parameters:
type - The new type.

getConceptualDataType

public long getConceptualDataType()
Specified by:
getConceptualDataType in interface BaseAttribute
Returns:
the conceptual data type.

setConceptualDataTypeName

public void setConceptualDataTypeName(java.lang.String dtname)
                               throws M4Exception
Set the name of the conceptual data type.

Specified by:
setConceptualDataTypeName in interface BaseAttribute
Parameters:
dtname - The new name of the conceptual data type.
Throws:
M4Exception

getConceptualDataTypeName

public java.lang.String getConceptualDataTypeName()
                                           throws M4Exception
Specified by:
getConceptualDataTypeName in interface BaseAttribute
Returns:
The name of this BaseAttribute's conceptual data type.
Throws:
M4Exception

setColumns

public void setColumns(java.util.Collection theColumns)
                throws M4Exception
Set all columns of this BaseAttribute.

Specified by:
setColumns in interface BaseAttribute
Parameters:
theColumns - A Collection of Column objects
Throws:
M4Exception

getColumns

public java.util.Collection getColumns()
                                throws M4Exception
Specified by:
getColumns in interface BaseAttribute
Returns:
The columns that belong to this BaseAttribute.
Throws:
M4Exception

getColumn

public Column getColumn(int index)
                 throws M4Exception
Get a specific column that belongs to this BaseAttribute.

Specified by:
getColumn in interface BaseAttribute
Returns:
The column with the given number.
Throws:
M4Exception

getCurrentColumn

public Column getCurrentColumn()
                        throws M4Exception
This method replaces "getColumnForColumnSet". The current column is the one that belongs to the current columnset of the concept that this BaseAttribute belongs to.

Specified by:
getCurrentColumn in interface BaseAttribute
Returns:
The current column.
Throws:
M4Exception
See Also:
Concept

setMCFeature

public void setMCFeature(MultiColumnFeature mcf)
                  throws M4Exception
If this BaseAttribute belongs to a MultiColumnFeature, set it here.

Specified by:
setMCFeature in interface BaseAttribute
Parameters:
mcf - The MultiColumnFeature this BaseAttribute belongs to.
Throws:
M4Exception
See Also:
MultiColumnFeature

getMCFeature

public MultiColumnFeature getMCFeature()
If this BaseAttribute belongs to a MultiColumnFeature, get it here.

Specified by:
getMCFeature in interface BaseAttribute
Returns:
The MultiColumnFeature if this BaseAttribute belongs to one, null otherwise.
See Also:
MultiColumnFeature

isRelevant

public boolean isRelevant()
Specified by:
isRelevant in interface BaseAttribute
Returns:
TRUE if this BaseAttribute is relevant.

getRelevantS

public java.lang.String getRelevantS()
Specified by:
getRelevantS in interface BaseAttribute
Returns:
the relevance of this BaseAttribute using the database String representation

setRelevant

public void setRelevant(boolean r)
Set the relevance of this BaseAttribute.

Specified by:
setRelevant in interface BaseAttribute
Parameters:
r - The new boolean value of the relevance.

setRelevantS

public void setRelevantS(java.lang.String r)
Set the relevance of this BaseAttribute.

Specified by:
setRelevantS in interface BaseAttribute
Parameters:
r - The value of the relevance in thedatabase String representation

isDBAttrib

public boolean isDBAttrib()
Specified by:
isDBAttrib in interface BaseAttribute
Returns:
TRUE if this BaseAttribute is a DB Attribute.

getDBAttribS

public java.lang.String getDBAttribS()
Getter for the DB Attribute property

Specified by:
getDBAttribS in interface BaseAttribute
Returns:
the boolean flag in its database String representation

getType

public java.lang.String getType()
Specified by:
getType in interface BaseAttribute

setDBAttrib

public void setDBAttrib(boolean a)
Setter for DBAttrib.

Specified by:
setDBAttrib in interface BaseAttribute
Parameters:
a - The new boolean value.

setDBAttribS

public void setDBAttribS(java.lang.String attrib)
Setter for DBAttrib.

Specified by:
setDBAttribS in interface BaseAttribute
Parameters:
attrib - The boolean value in its database String representation.

setType

public void setType(java.lang.String type)
             throws M4Exception
Description copied from interface: BaseAttribute
The type of the BaseAttribute

Specified by:
setType in interface BaseAttribute
Throws:
M4Exception
See Also:
TYPE_BASE, TYPE_DB, TYPE_MINING

isDeselected

public boolean isDeselected()
                     throws M4CompilerError
Specified by:
isDeselected in interface BaseAttribute
Specified by:
isDeselected in class Feature
Returns:
true iff this BaseAttribute has been "deselected" by a FeatureSelection operator or has not been connected by the user.
Throws:
M4CompilerError

primitiveSetMCFeature

public void primitiveSetMCFeature(MultiColumnFeature mcf)
Primitive setter, do not use.

Parameters:
mcf - the MultiColumnFeature to be set

isRelationallyValid

public boolean isRelationallyValid()
                            throws M4Exception
This method returns information about the relational validity of the object. A BaseAttribute is valid if it is connected to a Concept, and - for type DB: if it has a Column - for type MINING: if it is an output BA, or part of an output MCF or output Concept

Specified by:
isRelationallyValid in interface Feature
Throws:
M4Exception

readFromDbLocal

protected void readFromDbLocal()
                        throws M4Exception
Reads this object's Concept from a cross-table at loading time.

Overrides:
readFromDbLocal in class M4Data
Throws:
M4Exception

storeLocal

protected void storeLocal()
                   throws M4Exception
This method stores the pseudo foreign key reference to this objects's Concept, which is still realized by a cross-table (BA_CONCEPT_T).

Overrides:
storeLocal in class GraphicalM4Object
Throws:
M4Exception

deleteLocal

protected void deleteLocal()
                    throws M4Exception
Overwrites the superclass method to ensure that the cross table entries are deleted first

Overrides:
deleteLocal in class GraphicalM4Object
Throws:
M4Exception

removeAllM4References

protected void removeAllM4References()
                              throws M4Exception
Description copied from class: M4Data
This method needs to be implemented by all M4Data objects. It has to remove all references to other M4Objects.

Overrides:
removeAllM4References in class ParameterObject
Throws:
M4Exception
See Also:
M4Data.removeAllM4References()

getDependentObjects

public java.util.Collection getDependentObjects()
                                         throws M4Exception
Description copied from class: M4Data
This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized.

Specified by:
getDependentObjects in interface XmlInfo
Overrides:
getDependentObjects in class ParameterObject
Throws:
M4Exception
See Also:
M4Data.getDependentObjects()


Copyright © 2001-2005