Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.properties
Class PropertyName

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.ConstantObject<PropertyName>
          extended by de.lmu.ifi.dbs.elki.properties.PropertyName
All Implemented Interfaces:
Loggable, Serializable, Comparable<PropertyName>

public final class PropertyName
extends ConstantObject<PropertyName>

todo: remove old property names? PropertyName for lookup in property file for class definitions.

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
static PropertyName DEBUG_LEVEL
          Property debug level.
private static long serialVersionUID
          Serial version UID
private  Class<?> type
          The type related to the property.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
private PropertyName(String name, Class<?> type)
          Provides a new PropertyName of given name and type.
 
Method Summary
 Class<?> classForName(String classname)
          Returns a class for the given name.
static PropertyName getOrCreatePropertyName(Class<?> type)
          Gets the PropertyName for the given class named as the classes name if it exists, creates and returns it otherwise.
static PropertyName getPropertyName(String name)
          Returns the PropertyName for the given name if it exists, null otherwise.
 Class<?> getType()
          Returns the type of the PropertyName.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.ConstantObject
compareTo, equals, getName, hashCode, lookup, readResolve
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_LEVEL

public static final PropertyName DEBUG_LEVEL
Property debug level.


serialVersionUID

private static final long serialVersionUID
Serial version UID

See Also:
Constant Field Values

type

private Class<?> type
The type related to the property.

Constructor Detail

PropertyName

private PropertyName(String name,
                     Class<?> type)
Provides a new PropertyName of given name and type.

All PropertyNames are unique w.r.t. their name.

Parameters:
name - the name of the PropertyName
type - the type of the PropertyName
Method Detail

classForName

public Class<?> classForName(String classname)
                      throws ClassNotFoundException
Returns a class for the given name. If the name is not found, as package the default package defined by this PropertyName is tried. If this fails, the method throws a ClassNotFoundException.

Parameters:
classname - name of the class to return
Returns:
a class for the given name
Throws:
ClassNotFoundException - if the class for the given name is found neither on its own nor trying the default package as prefix

getType

public Class<?> getType()
Returns the type of the PropertyName.

Returns:
the type of the PropertyName

getOrCreatePropertyName

public static PropertyName getOrCreatePropertyName(Class<?> type)
Gets the PropertyName for the given class named as the classes name if it exists, creates and returns it otherwise.

Parameters:
type - a class as type and the class' name as name
Returns:
the PropertyName for the given class named as the classes name

getPropertyName

public static PropertyName getPropertyName(String name)
Returns the PropertyName for the given name if it exists, null otherwise.

Parameters:
name - name of the desired PropertyName
Returns:
the PropertyName for the given name

Release 0.1 (2008-07-10_1838)