Package org.eobjects.datacleaner.user

Examples of org.eobjects.datacleaner.user.QuickAnalysisStrategy


   * @param analyzerClass
   * @param columns
   */
  private void createAnalyzers(AnalysisJobBuilder ajb, Class<? extends RowProcessingAnalyzer<?>> analyzerClass,
      List<InputColumn<?>> columns) {
    final QuickAnalysisStrategy quickAnalysisStrategy = _userPreferences.getQuickAnalysisStrategy();
    final int columnsPerAnalyzer = quickAnalysisStrategy.getColumnsPerAnalyzer();

    RowProcessingAnalyzerJobBuilder<? extends RowProcessingAnalyzer<?>> analyzerJobBuilder = ajb
        .addRowProcessingAnalyzer(analyzerClass);
    int columnCount = 0;
    for (InputColumn<?> inputColumn : columns) {
      if (columnCount == columnsPerAnalyzer) {
        analyzerJobBuilder = ajb.addRowProcessingAnalyzer(analyzerClass);
        columnCount = 0;
      }
      analyzerJobBuilder.addInputColumn(inputColumn);

      if (quickAnalysisStrategy.isIncludeValueDistribution()) {
        ajb.addRowProcessingAnalyzer(ValueDistributionAnalyzer.class).addInputColumn(inputColumn);
      }
      if (inputColumn.getDataTypeFamily() == DataTypeFamily.STRING && quickAnalysisStrategy.isIncludePatternFinder()) {
        ajb.addRowProcessingAnalyzer(PatternFinderAnalyzer.class).addInputColumn(inputColumn);
      }
      columnCount++;
    }
  }
View Full Code Here


    return panel;
  }

  private DCPanel getQuickAnalysisPanel() {
    final QuickAnalysisStrategy quickAnalysisStrategy = _userPreferences.getQuickAnalysisStrategy();
    final JXTextField columnsTextField = WidgetFactory.createTextField("Columns");
    columnsTextField.setColumns(2);
    columnsTextField.setDocument(new NumberDocument());
    columnsTextField.setText("" + quickAnalysisStrategy.getColumnsPerAnalyzer());

    final JCheckBox valueDistributionCheckBox = new JCheckBox("Include Value distribution in Quick analysis?");
    valueDistributionCheckBox.setOpaque(false);
    valueDistributionCheckBox.setSelected(quickAnalysisStrategy.isIncludeValueDistribution());

    final JCheckBox patternFinderCheckBox = new JCheckBox("Include Pattern finder in Quick analysis?");
    patternFinderCheckBox.setOpaque(false);
    patternFinderCheckBox.setSelected(quickAnalysisStrategy.isIncludePatternFinder());

    final ActionListener actionListener = new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent event) {
        try {
          int columns = Integer.parseInt(columnsTextField.getText());
          QuickAnalysisStrategy newStrategy = new QuickAnalysisStrategy(columns,
              valueDistributionCheckBox.isSelected(), patternFinderCheckBox.isSelected());
          _userPreferences.setQuickAnalysisStrategy(newStrategy);
        } catch (NumberFormatException e) {
          // skip this action, could not parse columns
        }
View Full Code Here

TOP

Related Classes of org.eobjects.datacleaner.user.QuickAnalysisStrategy

Copyright © 2018 www.massapicom. 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.