本文整理汇总了Java中com.rapidminer.operator.nio.ExcelExampleSource.getSelectedFile方法的典型用法代码示例。如果您正苦于以下问题:Java ExcelExampleSource.getSelectedFile方法的具体用法?Java ExcelExampleSource.getSelectedFile怎么用?Java ExcelExampleSource.getSelectedFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.operator.nio.ExcelExampleSource
的用法示例。
在下文中一共展示了ExcelExampleSource.getSelectedFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExcelResultSetConfiguration
import com.rapidminer.operator.nio.ExcelExampleSource; //导入方法依赖的package包/类
/**
* This constructor must read in all settings from the parameters of the given operator.
*
* @throws OperatorException
*/
public ExcelResultSetConfiguration(ExcelExampleSource excelExampleSource) throws OperatorException {
if (excelExampleSource.isParameterSet(ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE)) {
parseExcelRange(excelExampleSource.getParameterAsString(ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE));
}
if (excelExampleSource.isParameterSet(PARAMETER_SHEET_NUMBER)) {
this.sheet = excelExampleSource.getParameterAsInt(PARAMETER_SHEET_NUMBER) - 1;
}
if (excelExampleSource.isFileSpecified()) {
this.workbookFile = excelExampleSource.getSelectedFile();
} else {
String excelParamter;
try {
excelParamter = excelExampleSource.getParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE);
} catch (UndefinedParameterError e) {
excelParamter = null;
}
if (excelParamter != null && !"".equals(excelParamter)) {
File excelFile = new File(excelParamter);
if (excelFile.exists()) {
this.workbookFile = excelFile;
}
}
}
if (excelExampleSource.isParameterSet(AbstractDataResultSetReader.PARAMETER_DATE_FORMAT)) {
datePattern = excelExampleSource.getParameterAsString(AbstractDataResultSetReader.PARAMETER_DATE_FORMAT);
}
if (excelExampleSource.isParameterSet(AbstractDataResultSetReader.PARAMETER_TIME_ZONE)) {
timezone = excelExampleSource.getParameterAsString(AbstractDataResultSetReader.PARAMETER_TIME_ZONE);
}
encoding = Encoding.getEncoding(excelExampleSource);
isEmulatingOldNames = excelExampleSource.getCompatibilityLevel()
.isAtMost(ExcelExampleSource.CHANGE_5_0_11_NAME_SCHEMA);
}
示例2: ExcelResultSetConfiguration
import com.rapidminer.operator.nio.ExcelExampleSource; //导入方法依赖的package包/类
/**
* This constructor must read in all settings from the parameters of the given operator.
*
* @throws OperatorException
*/
public ExcelResultSetConfiguration(ExcelExampleSource excelExampleSource) throws OperatorException {
if (excelExampleSource.isParameterSet(ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE)) {
parseExcelRange(excelExampleSource.getParameterAsString(ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE));
}
// else {
// throw new UserError(null, 205, ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE, excelExampleSource.getName());
// }
if (excelExampleSource.isParameterSet(PARAMETER_SHEET_NUMBER)) {
this.sheet = excelExampleSource.getParameterAsInt(PARAMETER_SHEET_NUMBER) - 1;
}
if (excelExampleSource.isFileSpecified()) {
this.workbookFile = excelExampleSource.getSelectedFile();
} else {
String excelParamter;
try {
excelParamter = excelExampleSource.getParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE);
} catch (UndefinedParameterError e) {
excelParamter = null;
}
if (excelParamter != null && !"".equals(excelParamter)) {
File excelFile = new File(excelParamter);
if (excelFile.exists()) {
this.workbookFile = excelFile;
}
}
}
// if (excelExampleSource.isParameterSet(PARAMETER_EXCEL_FILE)) {
// this.workbookFile = excelExampleSource.getParameterAsFile(PARAMETER_EXCEL_FILE);
// }
if (excelExampleSource.isParameterSet(AbstractDataResultSetReader.PARAMETER_DATE_FORMAT)) {
datePattern = excelExampleSource.getParameterAsString(AbstractDataResultSetReader.PARAMETER_DATE_FORMAT);
}
if (excelExampleSource.isParameterSet(AbstractDataResultSetReader.PARAMETER_TIME_ZONE)) {
timezone = excelExampleSource.getParameterAsString(AbstractDataResultSetReader.PARAMETER_TIME_ZONE);
}
encoding = Encoding.getEncoding(excelExampleSource);
isEmulatingOldNames = excelExampleSource.getCompatibilityLevel().isAtMost(ExcelExampleSource.CHANGE_5_0_11_NAME_SCHEMA);
}