Package dataSources

Source Code of dataSources.DSourcesLogic

package dataSources;

import DataAcquisition.DataSources;
import DataAcquisition.Domain;
import DataAcquisition.SearchOptions;
import java.util.ArrayList;

public class DSourcesLogic {
 
  private boolean twitter;
  private boolean amazon;
  private boolean epinions;
  //private ArrayList<String> features
  //ArrayList<DataSources> selectedSources = new ArrayList<DataSources>();
  //private Domain domain;
  private SearchOptions ops;
    public DSourcesLogic()
    {
      twitter = false;
      amazon = false;
      epinions = false;
      setOps(new SearchOptions());
    }
  public void setTwitter(boolean selected)
  {
    twitter = selected;
    //selectedSources.add(DataSources.Twitter); 
  }
  public boolean getTwitter()
  {
    return twitter;
  }
  public void setAmazon(boolean selected)
  {
    amazon = selected;
  }
  public boolean getAmazon()
  {
    return amazon;
  }
  public void setEpinions(boolean selected)
  {
    epinions = selected;
  }
  public boolean getEpinions()
  {
    return epinions;
  }
  private void setFeatures(ArrayList<String> features) {
    getOps().setFeatures(features);
  }
  private ArrayList<String> getFeatures() {
    return getOps().getFeatures();
  }
  private void setDomain(String dom) {
    getOps().setDomain(Domain.valueOf(Domain.class, dom));
    int x =0;
  }
  public void fillDataSources()
  {
    ArrayList<DataSources> selectedSources = new ArrayList<DataSources>();
    if(twitter)
    {
      selectedSources.add(DataSources.Twitter);
    }
    if(amazon)
    {
      selectedSources.add(DataSources.Amazon);
    }
    if(epinions)
    {
      selectedSources.add(DataSources.Epinions);
    }
    getOps().setdSource(selectedSources);
  }
  public void setPath(String path)
  {
    getOps().setFilePath(path);
    int x = 0;
    int y = x;
  }
  public String deleteAspect(String id)
  {
    int index = Integer.valueOf(id.substring(3));
    String cellId = "cell" + String.valueOf(index);
    return cellId;
  }
  public void doLogic(String s)
  {
    int x = 0;
    int y = x;
    /*
    JFileChooser chooser = new JFileChooser();
    FileNameExtensionFilter filter = new FileNameExtensionFilter(
      "JPG & GIF Images", "jpg", "gif");
    chooser.setFileFilter(filter);
    int returnVal = chooser.showOpenDialog(b);
    if(returnVal == JFileChooser.APPROVE_OPTION)
    {
       System.out.println("You chose to open this file: " +
        chooser.getSelectedFile().getName());
    }
    */
  }
  private void setOps(SearchOptions ops) {
    this.ops = ops;
  }
  public SearchOptions getOps() {
    return ops;
  }
  public void setQuery(String query){
    getOps().setTheQuery(query);
  }
}
TOP

Related Classes of dataSources.DSourcesLogic

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.