private Object getFeatureExtractorNames(List<TcFeature> featureExtractors) { String[] featureExtractorNames = new String[featureExtractors.size()]; for (int i = 0; i < featureExtractorNames.length; i++) { String implName; if (featureExtractors.get(i).getActualValue() .getResourceSpecifier() instanceof CustomResourceSpecifier) { implName = ((CustomResourceSpecifier) featureExtractors.get(i).getActualValue() .getResourceSpecifier()).getResourceClassName(); } else { implName = featureExtractors.get(i).getActualValue().getImplementationName(); } featureExtractorNames[i] = implName; } return featureExtractorNames; }
@Override public String toString() { return (String) getDiscriminatorValue(); } }
/** * Creates a new instance of a TcFeature * * @param featureName * The class of a feature extractor * @param parameters * The configuration parameters for this feature extractor * @return Configured feature which has a randomly assigned unique identification */ public static TcFeature create(Class<? extends Resource> featureName, Object... parameters) { /* * Each feature has to set a unique name which is build from the simple name of the feature * class and extended with a random value */ String id = featureName.getSimpleName() + System.nanoTime(); List<Object> params = getParameterAsString(parameters); params.add(FeatureExtractorResource_ImplBase.PARAM_UNIQUE_EXTRACTOR_NAME); params.add(id); TcFeature tcFeature = new TcFeature(featureName, id, params.toArray()); return tcFeature; }
ExternalResourceDescription feDesc = feClosure.getActualValue(); featureExtractorDescriptions.add(feDesc); .getMetaCollectorClasses(parameterSettings)) { MetaInfoTask.configureStorageLocations(aContext, feDesc.getResourceSpecifier(), (String) feClosure.getId(), conf.extractorOverrides, AccessMode.READONLY);
private StringBuilder copyParameters(TcFeature f, StringBuilder sb, File aOutputFolder) throws IOException { sb.append(f.getFeatureName() + "\t"); ExternalResourceDescription feDesc = f.getActualValue(); Map<String, Object> parameterSettings = ConfigurationParameterFactory .getParameterSettings(feDesc.getResourceSpecifier()); List<String> keySet = new ArrayList<>(parameterSettings.keySet()); for (int i = 0; i < keySet.size(); i++) { String key = keySet.get(i); String value = parameterSettings.get(key).toString(); if (valueExistAsFileOrFolderInTheFileSystem(value)) { String name = new File(value).getName(); String destination = aOutputFolder + "/" + name; copyToTargetLocation(new File(value), new File(destination)); sb = record(i, keySet, name, sb); continue; } sb = record(i, keySet, parameterSettings, sb); } sb.append("\n"); return sb; }
@Override public TcFeature current() { // When calling next() after rewind() to position current() at the first // dimension value, no config has been set yet. At this point just // do nothing. if (config == null) { return null; } closures[current].setConfig(config); return closures[current]; }
ExternalResourceDescription feDesc = feClosure.getActualValue(); featureExtractorDescriptions.add(feDesc); .getMetaCollectorClasses(parameterSettings)) { MetaInfoTask.configureStorageLocations(aContext, feDesc.getResourceSpecifier(), (String) feClosure.getId(), conf.extractorOverrides, AccessMode.READONLY);
private StringBuilder copyParameters(TcFeature f, StringBuilder sb, File aOutputFolder) throws IOException { sb.append(f.getFeatureName() + "\t"); ExternalResourceDescription feDesc = f.getActualValue(); Map<String, Object> parameterSettings = ConfigurationParameterFactory .getParameterSettings(feDesc.getResourceSpecifier()); List<String> keySet = new ArrayList<>(parameterSettings.keySet()); for (int i = 0; i < keySet.size(); i++) { String key = keySet.get(i); String value = parameterSettings.get(key).toString(); if (valueExistAsFileOrFolderInTheFileSystem(value)) { String name = new File(value).getName(); String destination = aOutputFolder + "/" + name; copyToTargetLocation(new File(value), new File(destination)); sb = record(i, keySet, name, sb); continue; } sb = record(i, keySet, parameterSettings, sb); } sb.append("\n"); return sb; }
@Override public TcFeature current() { // When calling next() after rewind() to position current() at the first // dimension value, no config has been set yet. At this point just // do nothing. if (config == null) { return null; } closures[current].setConfig(config); return closures[current]; }
private Object getFeatureExtractorNames(List<TcFeature> featureExtractors) { String[] featureExtractorNames = new String[featureExtractors.size()]; for (int i = 0; i < featureExtractorNames.length; i++) { String implName; if (featureExtractors.get(i).getActualValue() .getResourceSpecifier() instanceof CustomResourceSpecifier) { implName = ((CustomResourceSpecifier) featureExtractors.get(i).getActualValue() .getResourceSpecifier()).getResourceClassName(); } else { implName = featureExtractors.get(i).getActualValue().getImplementationName(); } featureExtractorNames[i] = implName; } return featureExtractorNames; }
ExternalResourceDescription feDesc = feClosure.getActualValue(); configureStorageLocations(aContext, conf.descriptor, (String) feClosure.getId(), conf.collectorOverrides, AccessMode.READWRITE); metaCollectors.add(conf.descriptor);
@Override public String toString() { return (String) getDiscriminatorValue(); } }
/** * Creates a new instance of a TcFeature * * @param featureName * The class of a feature extractor * @param parameters * The configuration parameters for this feature extractor * @return Configured feature which has a randomly assigned unique identification */ public static TcFeature create(Class<? extends Resource> featureName, Object... parameters) { /* * Each feature has to set a unique name which is build from the simple name of the feature * class and extended with a random value */ String id = featureName.getSimpleName() + System.nanoTime(); List<Object> params = getParameterAsString(parameters); params.add(FeatureExtractorResource_ImplBase.PARAM_UNIQUE_EXTRACTOR_NAME); params.add(id); TcFeature tcFeature = new TcFeature(featureName, id, params.toArray()); return tcFeature; }
ExternalResourceDescription exRes = feature.getActualValue();
ExternalResourceDescription feDesc = feClosure.getActualValue(); configureStorageLocations(aContext, conf.descriptor, (String) feClosure.getId(), conf.collectorOverrides, AccessMode.READWRITE); metaCollectors.add(conf.descriptor);
@Override public Object getDiscriminatorValue() { if (featureSetName != null) { return featureSetName; } StringBuilder sb = new StringBuilder(); int size = this.size(); for (int i = 0; i < size; i++) { TcFeature tcFeature = get(i); sb.append(tcFeature.getDiscriminatorValue()); if (i + 1 < size()) { sb.append(", "); } } return sb.toString(); }
/** * Creates a new instance of a TcFeature which allows the user to set an own id * * @param id * The id of the feature which must be unique among all used features * @param featureName * The class of the feature extractor that shall be instantiated * @param parameters * The list of the parameters for this feature extractor * @return A configured feature which is identified by a user provided identification string */ public static TcFeature create(String id, Class<? extends Resource> featureName, Object... parameters) { /* * Each feature has to set a unique name which is build from the simple name of the feature * class and extended with a random value */ List<Object> params = getParameterAsString(parameters); params.add(FeatureExtractorResource_ImplBase.PARAM_UNIQUE_EXTRACTOR_NAME); params.add(id); TcFeature tcFeature = new TcFeature(featureName, id, params.toArray()); return tcFeature; }
throws Exception ExternalResourceDescription feDesc = f.getActualValue(); Map<String, Object> parameterSettings = ConfigurationParameterFactory .getParameterSettings(feDesc.getResourceSpecifier());
@Override public Object getDiscriminatorValue() { if (featureSetName != null) { return featureSetName; } StringBuilder sb = new StringBuilder(); int size = this.size(); for (int i = 0; i < size; i++) { TcFeature tcFeature = get(i); sb.append(tcFeature.getDiscriminatorValue()); if (i + 1 < size()) { sb.append(", "); } } return sb.toString(); }
/** * Creates a new instance of a TcFeature which allows the user to set an own id * * @param id * The id of the feature which must be unique among all used features * @param featureName * The class of the feature extractor that shall be instantiated * @param parameters * The list of the parameters for this feature extractor * @return A configured feature which is identified by a user provided identification string */ public static TcFeature create(String id, Class<? extends Resource> featureName, Object... parameters) { /* * Each feature has to set a unique name which is build from the simple name of the feature * class and extended with a random value */ List<Object> params = getParameterAsString(parameters); params.add(FeatureExtractorResource_ImplBase.PARAM_UNIQUE_EXTRACTOR_NAME); params.add(id); TcFeature tcFeature = new TcFeature(featureName, id, params.toArray()); return tcFeature; }