jcolibri.test.test13.connector
Class RestaurantsConnector

java.lang.Object
  extended by jcolibri.test.test13.connector.RestaurantsConnector
All Implemented Interfaces:
Connector

public class RestaurantsConnector
extends java.lang.Object
implements Connector

Obtains cases from a simple txt file. This connector is thought to work with txt files that contain descriptions of restaurants following the format:

 NAME
 ADDRESS
 LOCATION
 PHONE
 DESCRIPTION
 AUTHOR_OF_DESCRIPTION
 
 
 NAME
 ADDRESS
 ...
 
This connector only reads cases but does not write anything to the text file.

Version:
1.0
Author:
Juan A. Recio-Garcia

Constructor Summary
RestaurantsConnector(java.lang.String sourceFile)
           
 
Method Summary
 void close()
          Cleanup any resource that the connector might be using, and suspends the service
 void deleteCases(java.util.Collection<CBRCase> cases)
          Deletes given cases for the storage media
 void initFromXMLfile(java.net.URL file)
          Initialices the connector with the given XML file
 java.util.Collection<CBRCase> retrieveAllCases()
          Returns max cases without any special consideration
 java.util.Collection<CBRCase> retrieveSomeCases(CaseBaseFilter filter)
          Retrieves some cases depending on the filter.
 void storeCases(java.util.Collection<CBRCase> cases)
          Stores given classes on the storage media
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestaurantsConnector

public RestaurantsConnector(java.lang.String sourceFile)
Method Detail

close

public void close()
Description copied from interface: Connector
Cleanup any resource that the connector might be using, and suspends the service

Specified by:
close in interface Connector

deleteCases

public void deleteCases(java.util.Collection<CBRCase> cases)
Description copied from interface: Connector
Deletes given cases for the storage media

Specified by:
deleteCases in interface Connector
Parameters:
cases - List of cases

initFromXMLfile

public void initFromXMLfile(java.net.URL file)
                     throws InitializingException
Description copied from interface: Connector
Initialices the connector with the given XML file

Specified by:
initFromXMLfile in interface Connector
Parameters:
file - XMl file with the settings
Throws:
InitializingException - Raised if the connector can not be initialezed.

retrieveAllCases

public java.util.Collection<CBRCase> retrieveAllCases()
Description copied from interface: Connector
Returns max cases without any special consideration

Specified by:
retrieveAllCases in interface Connector
Returns:
The list of retrieved cases

retrieveSomeCases

public java.util.Collection<CBRCase> retrieveSomeCases(CaseBaseFilter filter)
Description copied from interface: Connector
Retrieves some cases depending on the filter. TODO.

Specified by:
retrieveSomeCases in interface Connector

storeCases

public void storeCases(java.util.Collection<CBRCase> cases)
Description copied from interface: Connector
Stores given classes on the storage media

Specified by:
storeCases in interface Connector
Parameters:
cases - List of cases

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es