org.dllearner.core
Class AnnComponentManager

java.lang.Object
  extended by org.dllearner.core.AnnComponentManager

public class AnnComponentManager
extends Object

Component manager for the new (as of 2011) annotation based configuration system. In the future, this may replace the previous implementation of component manager.

Author:
Jens Lehmann

Method Summary
 boolean areValidComponentConstructorArguments(Class<? extends Component>... arguments)
          Components in DL-Learner can be plugged together by invoking an appropriate constructor.
 Collection<Class<? extends Component>> getComponents()
          Returns a list of all available components in this instance of ComponentManager.
 Map<Class<? extends Component>,String> getComponentsNamed()
          Convenience methed, which returns a list of components along with their name.
static List<Class<? extends Component>> getCoreComponentTypes(Class<? extends Component> component)
           
static String getDescription(Class<? extends Component> component)
          Returns the name of a DL-Learner component.
static String getDescription(Component component)
          Returns the description of a DL-Learner component.
static AnnComponentManager getInstance()
          Gets the singleton instance of ComponentManager.
static String getName(Class<? extends Component> component)
          Returns the name of a DL-Learner component.
static String getName(Component component)
          Returns the name of a DL-Learner component.
 Collection<Class<? extends Component>> getPluggableComponents(Class<? extends Component> component)
           
static String getShortName(Class<? extends Component> component)
          Returns the name of a DL-Learner component.
static String getShortName(Component component)
          Returns the short name of a DL-Learner component.
static double getVersion(Class<? extends Component> component)
          Returns the version of a DL-Learner component.
static double getVersion(Component component)
          Returns the version of a DL-Learner component.
 boolean isCompatible()
           
 boolean isCompatible(Class<? extends Component> compound, Class<? extends Component>... arguments)
           
 boolean isPluggable(Class<? extends Component> compound, Class<? extends Component> argument)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AnnComponentManager getInstance()
Gets the singleton instance of ComponentManager.

Returns:
The singleton ComponentManager instance.

getComponents

public Collection<Class<? extends Component>> getComponents()
Returns a list of all available components in this instance of ComponentManager.

Returns:
the components A list of component classes available in this instance of ComponentManager.

getComponentsNamed

public Map<Class<? extends Component>,String> getComponentsNamed()
Convenience methed, which returns a list of components along with their name.

Returns:
A map where the key is the class of the component and the value is its name.

isCompatible

public boolean isCompatible()

getPluggableComponents

public Collection<Class<? extends Component>> getPluggableComponents(Class<? extends Component> component)

isPluggable

public boolean isPluggable(Class<? extends Component> compound,
                           Class<? extends Component> argument)

isCompatible

public boolean isCompatible(Class<? extends Component> compound,
                            Class<? extends Component>... arguments)

areValidComponentConstructorArguments

public boolean areValidComponentConstructorArguments(Class<? extends Component>... arguments)
Components in DL-Learner can be plugged together by invoking an appropriate constructor. For efficiency reasons, they should be ordered by class names. This method allows to test this convention. Please note that components may have additional further constructors, but if a constructor has exclusively components as parameters, then it is required that they are ordered by class name. TODO: Possibly, we can replace our naive constructor detection code with a better implementation, which can detect whether an appropriate constructor exists even without fixing the order of arguments. (E.g. checking assignability for each parameter and argument; putting it into a matrix and then checking whether there is a row/column with only 1s.)

Parameters:
arguments - Argument classes.
Returns:
True of the order of arguments is correct and false otherwise.

getCoreComponentTypes

public static List<Class<? extends Component>> getCoreComponentTypes(Class<? extends Component> component)

getName

public static String getName(Class<? extends Component> component)
Returns the name of a DL-Learner component.

Parameters:
component -
Returns:
Name of the component.

getName

public static String getName(Component component)
Returns the name of a DL-Learner component.

Parameters:
component -
Returns:
Name of the component.

getShortName

public static String getShortName(Class<? extends Component> component)
Returns the name of a DL-Learner component.

Parameters:
component -
Returns:
Name of the component.

getShortName

public static String getShortName(Component component)
Returns the short name of a DL-Learner component.

Parameters:
component -
Returns:
Short name of the component.

getDescription

public static String getDescription(Class<? extends Component> component)
Returns the name of a DL-Learner component.

Parameters:
component -
Returns:
Name of the component.

getDescription

public static String getDescription(Component component)
Returns the description of a DL-Learner component.

Parameters:
component -
Returns:
Description of the component.

getVersion

public static double getVersion(Class<? extends Component> component)
Returns the version of a DL-Learner component.

Parameters:
component -
Returns:
Version of the component.

getVersion

public static double getVersion(Component component)
Returns the version of a DL-Learner component.

Parameters:
component -
Returns:
Version of the component.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann