Advertisement
Guest User

Untitled

a guest
Jan 15th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.06 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package roadnetwork.domain;
  7.  
  8. import data.access.layer.ProjectReader;
  9. import data.access.layer.DataAccessObject;
  10. import IO.ExportCSV;
  11. import IO.ExportHTML;
  12. import data.access.layer.ProjectWriter;
  13. import java.util.ArrayList;
  14. import roadnetwork.factory.ProjectStateFactory;
  15.  
  16. /**
  17.  *
  18.  * @author André Pedrosa, Hélder Faria, José Miranda, Rubén Rosário
  19.  */
  20. public class Manager {
  21.    
  22.     private String m_name;
  23.     private Project m_currentProject;
  24.     private DataAccessObject m_dataAccessObject;
  25.     private ArrayList<BestPathAlgorithm> m_algorithmsList;
  26.     //private ProjectReader m_projectReader;
  27.     //private ProjectWriter m_projectWriter;
  28.    
  29.    
  30.     /**
  31.      *
  32.      * @param name name
  33.      */
  34.     public Manager(String name){
  35.         m_name=name;
  36.         m_dataAccessObject=new DataAccessObject("jdbc:oracle:thin:@localhost:1521:XE", "grupo60", "pass60");
  37.         m_algorithmsList= new ArrayList<>();
  38.         //m_projectReader = new ProjectReader();
  39.         m_algorithmsList.add(new FastestPathAlgorithm());
  40.         m_algorithmsList.add(new TheoreticalMostEfficientPath());
  41.         m_algorithmsList.add(new MostEfficientPathRealConditions());
  42.        
  43.     }
  44.  
  45.     /**
  46.      *
  47.      * @return name
  48.      */
  49.     public String getM_name() {
  50.         return m_name;
  51.     }
  52.  
  53.     /**
  54.      *
  55.      * @return CurrentProject
  56.      */
  57.     public Project getCurrentProject() {
  58.         return m_currentProject;
  59.     }
  60.  
  61.     /**
  62.      * @return the dataAccessLayer
  63.      */
  64.     public DataAccessObject getdataAccessLayer() {
  65.         return m_dataAccessObject;
  66.     }
  67.    
  68.     /**
  69.      *
  70.      * @return AlgorithmsList
  71.      */
  72.     public ArrayList<BestPathAlgorithm> getAlgorithmsList(){
  73.         return m_algorithmsList;
  74.     }
  75.    
  76.     /**
  77.      *
  78.      * @param alg BestPathAlgorithm
  79.      */
  80.     public void addAlgorithm(BestPathAlgorithm alg){
  81.         m_algorithmsList.add(alg);
  82.     }
  83.  
  84.     /**
  85.      *
  86.      * @param fileName filename
  87.      * @return new ExportCSV
  88.      */
  89.     public ExportCSV newCSV(String fileName) {
  90.        
  91.         return new ExportCSV(fileName);
  92.     }
  93.  
  94.     /**
  95.      *
  96.      * @return ProjectReader
  97.      */
  98.     public ProjectReader getProjectReader() {
  99.         return new ProjectReader(m_dataAccessObject, new ProjectStateFactory());
  100.     }
  101.  
  102.     /**
  103.      *
  104.      * @param project project
  105.      * @return operation result
  106.      */
  107.     public boolean setCurrentProject(Project project) {
  108.         m_currentProject=project;
  109.         return true;
  110.     }
  111.  
  112.     /**
  113.      *
  114.      * @return ProjectWriter
  115.      */
  116.     public ProjectWriter getProjectWriter() {
  117.         return new ProjectWriter(m_dataAccessObject);
  118.  
  119.     }
  120.    
  121.     /**
  122.      *
  123.      * @param fileName filename
  124.      * @return ExportHTML
  125.      */
  126.     public ExportHTML newHTML(String fileName){
  127.         return new ExportHTML(fileName);
  128.     }
  129.    
  130.    
  131.    
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement