Package org.cishell.framework.data

Examples of org.cishell.framework.data.BasicData


            this.ciContext = ciContext;
        }
       
        public Data[] execute() throws AlgorithmExecutionException {
            try {
                Data data = new BasicData(getDataset(),format);
                data.getMetadata().put(DataProperty.LABEL, label);
           
                return new Data[]{data};
            } catch (IOException e) {
                throw new AlgorithmExecutionException(e);
            }
View Full Code Here


      if (i < formats.length) {
        File f = (File) nameToFileMap.remove(file);

        if (f != null) {
          data[i] = new BasicData(f, formats[i]);

          String label = properties.getProperty("outFile[" + i + "].label", f.getName());
          data[i].getMetadata().put(DataProperty.LABEL, label);

          String type =
            properties.getProperty("outFile[" + i + "].type", DataProperty.OTHER_TYPE);
          type = type.trim();
          if (type.equalsIgnoreCase(DataProperty.MATRIX_TYPE)) {
            type = DataProperty.MATRIX_TYPE;
          } else if (type.equalsIgnoreCase(DataProperty.NETWORK_TYPE)) {
            type = DataProperty.NETWORK_TYPE;
          } else if (type.equalsIgnoreCase(DataProperty.TREE_TYPE)) {
            type = DataProperty.TREE_TYPE;
          } else if (type.equalsIgnoreCase(DataProperty.TEXT_TYPE)) {
            type = DataProperty.TEXT_TYPE;
          } else if (type.equalsIgnoreCase(DataProperty.PLOT_TYPE)) {
            type = DataProperty.PLOT_TYPE;
          } else if (type.equalsIgnoreCase(DataProperty.TABLE_TYPE)) {
            type = DataProperty.TABLE_TYPE;
          } else {
            type = DataProperty.OTHER_TYPE;
          }

          data[i].getMetadata().put(DataProperty.TYPE, type);
        }
      } else {
        Iterator iter = nameToFileMap.values().iterator();
        while (iter.hasNext()) {
          File f = (File) iter.next();

          data[i] = new BasicData(f, "file:text/plain");
          data[i].getMetadata().put(DataProperty.LABEL, f.getName());

          i++;
        }
        break;
View Full Code Here

   
    public Data[] execute() throws AlgorithmExecutionException {
      this.stream = createStream();
      this.outStreamContainer =
        new BasicData(stream, Stream.class.getName());
        return new Data[]{ outStreamContainer };
    }
View Full Code Here

        numFinalResults = rawResults.size();
      }
     
      for (int ii = 0; ii < numFinalResults; ii++) {
      Object rawResult = rawResults.get(ii);
      BasicData data = new BasicData(rawResult, formats[ii]);
      results.add(data);
      }
      return results;
    }
View Full Code Here

         * @param type whether the report is a network or text file
         * @return the report encapsulated in data, ready to be returned.
         */
        private Data createReportData(Object report, String label,
            Data parent, String format, String type) {
          Data reportData = new BasicData(report, format);
      Dictionary metadata = reportData.getMetadata();
      if (label == null) {
        label = "no label";
      }
     
      if (type == null) {
View Full Code Here

        this.parameters = parameters;
        this.context = context;
    }

    public Data[] execute() throws AlgorithmExecutionException {
      Data[] output = new Data[]{new BasicData(new RandomNumberStream(), StreamImpl.class.getName())};
     
        return output;
    }
View Full Code Here

        new ConverterGraphComputation(allConverterServices, logger);
     
      /*
       * Used to generate the output reference for graph containing the network.
       * */
      return prepareOutputMetadata(new BasicData(converterGraphComputation.getOutputGraph(),
                     Graph.class.getName()));
  }
View Full Code Here

    return getAlgorithmFactoryByFilter(filter, bundleContext);
  }
 
  public static Data[] cloneSingletonData(Data[] data) {
    return new Data[] {
      new BasicData(data[0].getMetadata(), data[0].getData(), data[0].getFormat())
    };
  }
View Full Code Here

      this.selectedConverter = viewDataChooser.getSelectedConverter();
    }
  }

  private static Data cloneDataWithCleanedLabelForConversion(Data originalData) {
    Data clonedData = new BasicData(originalData.getData(), originalData.getFormat());
    Dictionary<String, Object> originalMetadata = originalData.getMetadata();
    Dictionary<String, Object> clonedMetadata = clonedData.getMetadata();

    for (Enumeration<String> keys = originalMetadata.keys(); keys.hasMoreElements();) {
      String key = keys.nextElement();

      if (DataProperty.LABEL.equals(key)) {
View Full Code Here

      AlgorithmFactory validator,
      ProgressMonitor progressMonitor,
      CIShellContext ciShellContext,
      LogService logger) throws AlgorithmExecutionException {
    Data[] validationData =
      new Data[] { new BasicData(file.getPath(), String.class.getName()) };
    Algorithm algorithm = validator.createAlgorithm(
      validationData, new Hashtable<String, Object>(), ciShellContext);

    if ((progressMonitor != null) && (algorithm instanceof ProgressTrackable)) {
      ProgressTrackable progressTrackable = (ProgressTrackable)algorithm;
View Full Code Here

TOP

Related Classes of org.cishell.framework.data.BasicData

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.