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

java.lang.Object
  extended by edu.udo.cs.miningmart.m4.core.Roles
All Implemented Interfaces:
Roles

public class Roles
extends java.lang.Object
implements Roles

This class represents the roless stored in the M4 model and takes care of mapping between the ID and name representations. One instance of this class (e.g. static in class BaseAttribute is sufficient, adding/changing the predefined set of roles at runtime is not supported.

Author:
Timm Euler

Field Summary
static java.lang.String ATTRIB_ROLE_ID
          Database attribute name storing the role IDs
static java.lang.String ATTRIB_ROLE_NAME
          Database attribute name storing the role names
static java.lang.String M4_TABLE_NAME
          Name of the M4 table mapping IDs to roles
 
Fields inherited from interface edu.udo.cs.miningmart.m4.Roles
ROLE_KEY, ROLE_LABEL, ROLE_NOROLE, ROLE_PREDICTOR, ROLES
 
Constructor Summary
Roles(DB db)
           
 
Method Summary
 long getIdForName(java.lang.String name)
           
 java.lang.String getNameForId(long id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
Name of the M4 table mapping IDs to roles

See Also:
Constant Field Values

ATTRIB_ROLE_ID

public static final java.lang.String ATTRIB_ROLE_ID
Database attribute name storing the role IDs

See Also:
Constant Field Values

ATTRIB_ROLE_NAME

public static final java.lang.String ATTRIB_ROLE_NAME
Database attribute name storing the role names

See Also:
Constant Field Values
Constructor Detail

Roles

public Roles(DB db)
      throws M4Exception,
             DbConnectionClosed
Throws:
M4Exception
DbConnectionClosed
Method Detail

getIdForName

public long getIdForName(java.lang.String name)
Specified by:
getIdForName in interface Roles
Parameters:
name - the name of a role (case senitive)
Returns:
the id representing this role or 0 if not found

getNameForId

public java.lang.String getNameForId(long id)
Specified by:
getNameForId in interface Roles
Parameters:
id - the ID of a role
Returns:
the role's name


Copyright © 2001-2005