ucot.core
Class Core

java.lang.Object
  extended by ucot.core.Core
All Implemented Interfaces:
ControlInterface

public class Core
extends java.lang.Object
implements ControlInterface

This is the implementation of core of the program, the controller of the program.


Field Summary
private  HeuristicInterface currentHeuristic
           
private  ParserInterface currentParser
           
private  java.util.Vector<HeuristicInterface> heuristics
           
private  InputCollection inputs
           
private  AnalyzeModel model
           
private  java.util.Vector<OutputInterface> outputs
           
private  java.util.Vector<ParserInterface> parsers
           
private  UIInterface ui
           
private  UseCaseCollection usecases
           
 
Constructor Summary
Core()
           
 
Method Summary
 void addToAnalyzeModel(UseCase usecase)
          Requests core to parse use case, perform heuristic on it and add it to given analyze model
 void addToAnalyzeModel(UseCase usecase, ParserInterface parser)
          Requests core to parse use case, perform heuristic on it and add it to given analyze model
 void addToAnalyzeModel(UseCase usecase, ParserInterface parser, HeuristicInterface heuristic)
          Requests core to parse use case, perform heuristic on it and add it to given analyze model
 void clearAnalyzeModel()
          Clears the whole analyze model.
 AnalyzeModel getAnalyzeModel()
          returns vector of all analyze models from CORE
 HeuristicInterface getCurrentHeuristic()
          returns the current heuristic
 ParserInterface getCurrentParser()
          returns the current default parser
 java.util.Vector<HeuristicInterface> getHeuristics()
          Returns a list of heuristics that are available
 InputCollection getInputs()
          Returns a list of input adapters available.
 java.util.Vector<OutputInterface> getOutputs()
          Returns a list of output adapters available.
 java.util.Vector<ParserInterface> getParsers()
          Returns a vector of parsers that are available
 UseCaseCollection getUseCaseCollection()
          Returns all loaded usecases
 void loadAnalyzeModel(java.net.URL url)
          Loads analyze model from a file
 void loadUseCases(java.net.URL url)
          Loads usecases from file
static void main(java.lang.String[] args)
          Main method that starts the core.
 void output(java.net.URL url, OutputInterface output, AnalyzeModel model)
          Exports given analyze model to given url using given outputadapter
 void saveAnalyzeModel(java.net.URL url)
          Saves analyze model to a file
 void setCurrentHeuristic(HeuristicInterface heuristic)
          Sets the default heuristic to use.
 void setCurrentParser(ParserInterface parser)
          Sets the default parser to use.
 void shutdown()
          Shuts down the program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputs

private InputCollection inputs

usecases

private UseCaseCollection usecases

model

private AnalyzeModel model

heuristics

private java.util.Vector<HeuristicInterface> heuristics

parsers

private java.util.Vector<ParserInterface> parsers

outputs

private java.util.Vector<OutputInterface> outputs

ui

private UIInterface ui

currentParser

private ParserInterface currentParser

currentHeuristic

private HeuristicInterface currentHeuristic
Constructor Detail

Core

public Core()
Method Detail

main

public static void main(java.lang.String[] args)
Main method that starts the core.

Parameters:
args -

shutdown

public void shutdown()
Description copied from interface: ControlInterface
Shuts down the program.

Specified by:
shutdown in interface ControlInterface

loadUseCases

public void loadUseCases(java.net.URL url)
Description copied from interface: ControlInterface
Loads usecases from file

Specified by:
loadUseCases in interface ControlInterface
Parameters:
url - url of the file

loadAnalyzeModel

public void loadAnalyzeModel(java.net.URL url)
Description copied from interface: ControlInterface
Loads analyze model from a file

Specified by:
loadAnalyzeModel in interface ControlInterface
Parameters:
url - url of the file containing analyze model

getUseCaseCollection

public UseCaseCollection getUseCaseCollection()
Description copied from interface: ControlInterface
Returns all loaded usecases

Specified by:
getUseCaseCollection in interface ControlInterface
Returns:
use case colletion

clearAnalyzeModel

public void clearAnalyzeModel()
Description copied from interface: ControlInterface
Clears the whole analyze model.

Specified by:
clearAnalyzeModel in interface ControlInterface

addToAnalyzeModel

public void addToAnalyzeModel(UseCase usecase,
                              ParserInterface parser,
                              HeuristicInterface heuristic)
                       throws java.lang.Exception
Description copied from interface: ControlInterface
Requests core to parse use case, perform heuristic on it and add it to given analyze model

Specified by:
addToAnalyzeModel in interface ControlInterface
parser - Parser to use
heuristic - heuristic to use
Throws:
java.lang.Exception

addToAnalyzeModel

public void addToAnalyzeModel(UseCase usecase,
                              ParserInterface parser)
                       throws java.lang.Exception
Description copied from interface: ControlInterface
Requests core to parse use case, perform heuristic on it and add it to given analyze model

Specified by:
addToAnalyzeModel in interface ControlInterface
parser - Parser to use
Throws:
java.lang.Exception

addToAnalyzeModel

public void addToAnalyzeModel(UseCase usecase)
                       throws java.lang.Exception
Description copied from interface: ControlInterface
Requests core to parse use case, perform heuristic on it and add it to given analyze model

Specified by:
addToAnalyzeModel in interface ControlInterface
Throws:
java.lang.Exception

getAnalyzeModel

public AnalyzeModel getAnalyzeModel()
Description copied from interface: ControlInterface
returns vector of all analyze models from CORE

Specified by:
getAnalyzeModel in interface ControlInterface
Returns:
specified analyze model

getParsers

public java.util.Vector<ParserInterface> getParsers()
Description copied from interface: ControlInterface
Returns a vector of parsers that are available

Specified by:
getParsers in interface ControlInterface
Returns:
vector containing parser adapters

getHeuristics

public java.util.Vector<HeuristicInterface> getHeuristics()
Description copied from interface: ControlInterface
Returns a list of heuristics that are available

Specified by:
getHeuristics in interface ControlInterface
Returns:
vector containing heuristic adapter

getOutputs

public java.util.Vector<OutputInterface> getOutputs()
Description copied from interface: ControlInterface
Returns a list of output adapters available.

Specified by:
getOutputs in interface ControlInterface
Returns:
vector containing output adapter names

getInputs

public InputCollection getInputs()
Description copied from interface: ControlInterface
Returns a list of input adapters available.

Specified by:
getInputs in interface ControlInterface
Returns:
vector containing input adapter names

setCurrentParser

public void setCurrentParser(ParserInterface parser)
Description copied from interface: ControlInterface
Sets the default parser to use.

Specified by:
setCurrentParser in interface ControlInterface
Parameters:
parser - Parser to be used by default

setCurrentHeuristic

public void setCurrentHeuristic(HeuristicInterface heuristic)
Description copied from interface: ControlInterface
Sets the default heuristic to use.

Specified by:
setCurrentHeuristic in interface ControlInterface
Parameters:
heuristic - default heuristic to be used

getCurrentParser

public ParserInterface getCurrentParser()
Description copied from interface: ControlInterface
returns the current default parser

Specified by:
getCurrentParser in interface ControlInterface
Returns:
default parser

getCurrentHeuristic

public HeuristicInterface getCurrentHeuristic()
Description copied from interface: ControlInterface
returns the current heuristic

Specified by:
getCurrentHeuristic in interface ControlInterface
Returns:
current heuristic

output

public void output(java.net.URL url,
                   OutputInterface output,
                   AnalyzeModel model)
            throws java.lang.Exception
Description copied from interface: ControlInterface
Exports given analyze model to given url using given outputadapter

Specified by:
output in interface ControlInterface
Parameters:
url - destination url
output - output adapter
model - analyzemodel to export
Throws:
java.lang.Exception

saveAnalyzeModel

public void saveAnalyzeModel(java.net.URL url)
Description copied from interface: ControlInterface
Saves analyze model to a file

Specified by:
saveAnalyzeModel in interface ControlInterface
Parameters:
url - target file