lio.core
Class LiOConfiguration

java.lang.Object
  extended by lio.core.LiOConfiguration

public class LiOConfiguration
extends java.lang.Object

This class encapsulates the default configuration of the library. That is datatypes, resources and relations between them. In fact this informations is stored in a file called lio.conf and can be easily modified to reflect new changes


Constructor Summary
LiOConfiguration()
          Creates a new instance of LiO by reading the configuration file and store all the information about available resources
 
Method Summary
 boolean checkCompatibility(java.lang.String pResource)
          Returns true if the class that implements this resource is available for the kind of data that uses the task.
 boolean checkCompatibility(java.lang.String pResource, java.lang.String pKindOfData)
          Tells whether the resource is available for a given kind of data.
 java.lang.String getDefaultRes(java.lang.String pKindOfData, java.lang.String pKindOfResource)
          Returns the name of resource used as default with some kind of data and interface.
 java.util.ArrayList<java.lang.String> getListOfResources(java.lang.String pKindOfResource)
          Extracts the list of resources that are data-type independent.
 java.util.ArrayList<java.lang.String> getListOfResources(java.lang.String pKindOfResource, java.lang.String pKindOfData)
          Extracts the list of resources for each kind of data and interface.
 java.util.List<java.lang.String> getProblemsList()
           
 java.util.List<java.lang.String> getSearchAlgList()
           
static void main(java.lang.String[] args)
          Main class to test the class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiOConfiguration

public LiOConfiguration()
                 throws java.io.IOException
Creates a new instance of LiO by reading the configuration file and store all the information about available resources

Throws:
java.lang.Exception - if can't read configuration file or it's not well formed
java.io.IOException
Method Detail

getDefaultRes

public java.lang.String getDefaultRes(java.lang.String pKindOfData,
                                      java.lang.String pKindOfResource)
                               throws java.lang.Exception
Returns the name of resource used as default with some kind of data and interface.

Parameters:
pKindOfData - kind of data we are working with.
pKindOfResource - kind of resource whose instantiation is demanded.
Returns:
name of the class implementing the resource.
Throws:
java.lang.Exception - if no resource is found for this kind of datatype

checkCompatibility

public boolean checkCompatibility(java.lang.String pResource,
                                  java.lang.String pKindOfData)
Tells whether the resource is available for a given kind of data.

Parameters:
pResource - name of the resource whose compatibility is being checked.
pKindOfData - kind of data we are working with.
Returns:
true if the class that implements some resource is available for this kind of data.

checkCompatibility

public boolean checkCompatibility(java.lang.String pResource)
Returns true if the class that implements this resource is available for the kind of data that uses the task.

Parameters:
pResource - name of the resource whose compatibility is being checked.
Returns:
true if the resource is available for the kind of data that uses the task.

getListOfResources

public java.util.ArrayList<java.lang.String> getListOfResources(java.lang.String pKindOfResource,
                                                                java.lang.String pKindOfData)
Extracts the list of resources for each kind of data and interface.

Parameters:
pKindOfResource - kind of resource that is going to be listed.
pKindOfData - kind of data we are working with.
Returns:
the list containing all the available resources for each case.

getListOfResources

public java.util.ArrayList<java.lang.String> getListOfResources(java.lang.String pKindOfResource)
Extracts the list of resources that are data-type independent.

Parameters:
pKindOfResource - kind of resource that is going to be listed.
Returns:
the list containing all the available resources for each case.

getProblemsList

public java.util.List<java.lang.String> getProblemsList()
Returns:
the list of problems included in the library

getSearchAlgList

public java.util.List<java.lang.String> getSearchAlgList()
Returns:
the list of search algorithms included in the library

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main class to test the class

Throws:
java.lang.Exception