|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlio.search.LiOSearch
public abstract class LiOSearch
This class implements the common features of every search method and contains all necessary elements to perform search.
Field Summary | |
---|---|
protected javax.swing.event.EventListenerList |
listenerList
Holds all EventListeners |
(package private) static java.lang.String |
outputFile
If not null, writes data on the specified file |
protected SearchOutput |
searchOutput
Object that contains and computes statistics of the search. |
(package private) static boolean |
showResults
Determines whether to show or not results by standard output |
protected StopCondition |
stopCondition
Determines the stopping condition of the search. |
protected boolean |
stopFlag
Shows whether the execution must be halted |
Constructor Summary | |
---|---|
LiOSearch()
|
Method Summary | |
---|---|
void |
addLiOEventListener(LiOEventListener listener)
This method allows objects to register for FinishEvent |
protected boolean |
build()
Builds the search by getting the resources from default configuration or from a file configuration if present. |
protected void |
cleanExecution()
This method should be invoked as the last action in the algorithm execution. |
static boolean |
execute(LiOSearch algorithm,
java.lang.String[] options)
This method performs all operations needed to launch an algorithm. |
protected void |
fireFinishEvent(FinishEvent evt)
This protected method is used to fire FinishEvent |
SearchOutput |
getSearchOutput()
|
StopCondition |
getStopCondition()
|
boolean |
initialize()
Performs all actions needed in order to prepare an algorithm to be executed |
boolean |
initialize(boolean changeTask,
boolean changeAlg)
Performs all actions needed in order to prepare an algorithm to be executed |
void |
loadSearchOutput(java.lang.String className)
|
void |
loadStatistics(java.lang.String className)
|
void |
loadStopCondition(java.lang.String className)
|
void |
removeLiOEventListener(LiOEventListener listener)
This method allows objects to unregister for FinishEvent |
void |
setOptions(java.lang.String[] options)
Sets up parameters of search from command line. |
void |
setSearchOutput(SearchOutput searchOutput)
|
void |
setStopCondition(StopCondition stopCondition)
|
void |
setTask(java.lang.String pTask)
Creates a new instance of a LiOTask class to solve it whit this algorithm |
void |
showOptions()
Shows generic options for search |
protected boolean |
stopCondition()
This method tells whether the algorithm's execution is due to end. |
void |
stopSearching()
Sets stopFlag to true in order to stop the execution. |
void |
updateTaskDependentResources(LiOResource res)
|
abstract boolean |
worksWith(LiOTask kindOfTask)
Allows knowing if the specified algorithm is able to process the task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface lio.core.LiOResource |
---|
getDefinition |
Methods inherited from interface java.lang.Runnable |
---|
run |
Field Detail |
---|
protected SearchOutput searchOutput
protected StopCondition stopCondition
protected boolean stopFlag
protected javax.swing.event.EventListenerList listenerList
static boolean showResults
static java.lang.String outputFile
Constructor Detail |
---|
public LiOSearch()
Method Detail |
---|
public void addLiOEventListener(LiOEventListener listener)
public void removeLiOEventListener(LiOEventListener listener)
protected void fireFinishEvent(FinishEvent evt)
public void stopSearching()
protected boolean stopCondition()
protected void cleanExecution()
public void showOptions()
public void setOptions(java.lang.String[] options) throws java.lang.Exception
options
- Search options.
java.lang.Exception
public void setTask(java.lang.String pTask)
pTask
- Full qualified class or path to a class file representing task
to solvepublic boolean initialize()
public boolean initialize(boolean changeTask, boolean changeAlg)
changeTask
- tells whether task object must be reloadedchangeAlg
- tells whether search object must be reconstructed
protected boolean build()
public void updateTaskDependentResources(LiOResource res)
public void loadSearchOutput(java.lang.String className)
public void loadStopCondition(java.lang.String className)
public void loadStatistics(java.lang.String className)
public abstract boolean worksWith(LiOTask kindOfTask)
public static boolean execute(LiOSearch algorithm, java.lang.String[] options)
algorithm
- Algorithm to executeoptions
- Command line options
public SearchOutput getSearchOutput()
public void setSearchOutput(SearchOutput searchOutput)
searchOutput
- The searchOutput to set.public StopCondition getStopCondition()
public void setStopCondition(StopCondition stopCondition)
stopCondition
- The stopCondition to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |