当前位置: 首页>>代码示例>>Java>>正文


Java ParsingError类代码示例

本文整理汇总了Java中com.rapidminer.operator.nio.model.ParsingError的典型用法代码示例。如果您正苦于以下问题:Java ParsingError类的具体用法?Java ParsingError怎么用?Java ParsingError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ParsingError类属于com.rapidminer.operator.nio.model包,在下文中一共展示了ParsingError类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getValueAt

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
	ParsingError error = errors.get(rowIndex);
	switch (columnIndex) {
		case 0:
			if (error.getRow() < 0 && error.getColumn() < 0) {
				if (error.getColumns() == null) {
					return "";
				} else {
					return "columns " + listToString(error.getColumns());
				}
			} else {
				return error.getRow() + 1 + ", " + (error.getColumn() + 1);
			}
		case 1:
			return error.getErrorCode().getMessage();
		case 2:
			return error.getOriginalValue();
		case 3:
			return error.getCause() != null ? error.getCause().getMessage() : null;
		default:
			return null;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:25,代码来源:ErrorTableModel.java

示例2: setErrors

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public void setErrors(Collection<ParsingError> errors) {
	if (!this.errors.equals(errors)) {
		this.errors.clear();
		this.errors.addAll(errors);
		Collections.sort(this.errors, new Comparator<ParsingError>() {

			@Override
			public int compare(ParsingError o1, ParsingError o2) {
				int rowDiff = o1.getRow() - o2.getRow();
				if (rowDiff != 0) {
					return rowDiff;
				} else {
					return o1.getColumn() - o2.getColumn();
				}
			}
		});
		fireTableStructureChanged();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:ErrorTableModel.java

示例3: checkForDuplicates

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public void checkForDuplicates() {
	oldDuplicateNameColumn.clear();
	oldDuplicateNameColumn.addAll(duplicateNameColumn);
	duplicateNameColumn.clear();
	
	oldDuplicateRoleColumn.clear();
	oldDuplicateRoleColumn.addAll(duplicateRoleColumn);
	duplicateRoleColumn.clear();
	
	errorList = new ArrayList<ParsingError>();
	
	for (Entry<String, List<Integer>> roleEntry : columnRoles.entrySet()) {
		if (roleEntry.getValue().size() > 1 && !roleEntry.getKey().equals("attribute")) {
			errorList.add(new ParsingError(roleEntry.getValue(), ParsingError.ErrorCode.SAME_ROLE_FOR_MULTIPLE_COLUMNS, roleEntry.getKey()));
			duplicateRoleColumn.addAll(roleEntry.getValue());
		}
	}

	for (Entry<String, List<Integer>> nameEntry : columnNames.entrySet()) {
		if (nameEntry.getValue().size() > 1) {
			errorList.add(new ParsingError(nameEntry.getValue(), ParsingError.ErrorCode.SAME_NAME_FOR_MULTIPLE_COLUMNS, nameEntry.getKey()));
			duplicateNameColumn.addAll(nameEntry.getValue());
		}
	}
	checkIfUpdate();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:27,代码来源:MetaDataValidator.java

示例4: getValueAt

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
	ParsingError error = errors.get(rowIndex);
	switch (columnIndex) {
	case 0:
		if(error.getRow() < 0 && error.getColumn() < 0) {
			return "columns " + listToString(error.getColumns());
		} else {
			return (error.getRow()+1) + ", " + (error.getColumn()+1);
		}
	case 1:
		return error.getErrorCode().getMessage();
	case 2:
		return error.getOriginalValue();
	case 3:
		return error.getCause() != null ? error.getCause().getMessage() : null;
	default:
		return null;
	}		
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:21,代码来源:ErrorTableModel.java

示例5: setErrors

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public void setErrors(Collection<ParsingError> errors) {
	if (!this.errors.equals(errors)) {
		this.errors.clear();
		this.errors.addAll(errors);
		Collections.sort(this.errors, new Comparator<ParsingError>() {
			@Override
			public int compare(ParsingError o1, ParsingError o2) {
				int rowDiff = o1.getRow() - o2.getRow();
				if (rowDiff != 0) {
					return rowDiff;
				} else {
					return o1.getColumn() - o2.getColumn();
				}
			}
		});
		fireTableStructureChanged();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:19,代码来源:ErrorTableModel.java

示例6: getDate

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
public Date getDate(int columnIndex) throws ParseException {
	String dateValue = getValue(columnIndex);
	if (dateValue == null) {
		return null;
	}
	switch (getCellType(columnIndex)) {
		case NUMBER:
		case DATE:
			// XLSX stores dates as double values
			double dateAsDouble = Double.parseDouble(dateValue);

			// Use POI methods to convert value to Date java object
			if (DateUtil.isValidExcelDate(dateAsDouble)) {
				return DateUtil.getJavaDate(dateAsDouble, xlsxWorkbook.isDate1904);
			} else {
				throw new ParseException(new ParsingError(getCurrentRow() + 1, columnIndex,
						ParsingError.ErrorCode.UNPARSEABLE_DATE, dateValue));
			}
		case INLINE_STRING:
		case SHARED_STRING:
		case STRING:
			// In case a date is stored as String, we try to parse it here
			String dateString = dateValue;
			try {
				return dateFormatProvider.geDateFormat().parse(dateString);
			} catch (java.text.ParseException e) {
				throw new ParseException(new ParsingError(getCurrentRow() + 1, columnIndex,
						ParsingError.ErrorCode.UNPARSEABLE_DATE, dateString));
			}
		default:
			throw new ParseException(new ParsingError(getCurrentRow() + 1, columnIndex,
					ParsingError.ErrorCode.UNPARSEABLE_DATE, dateValue));

	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:XlsxResultSet.java

示例7: getNumber

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
public Number getNumber(int columnIndex) throws ParseException {
	String numberValue = getValue(columnIndex);
	if (numberValue == null) {
		return null;
	}
	try {
		return Double.valueOf(numberValue);
	} catch (NumberFormatException e) {
		throw new ParseException(new ParsingError(getCurrentRow() + 1, columnIndex,
				ParsingError.ErrorCode.UNPARSEABLE_REAL, numberValue));
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:XlsxResultSet.java

示例8: checkForDuplicates

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public void checkForDuplicates() {
	oldDuplicateNameColumn.clear();
	oldDuplicateNameColumn.addAll(duplicateNameColumn);
	duplicateNameColumn.clear();

	oldDuplicateRoleColumn.clear();
	oldDuplicateRoleColumn.addAll(duplicateRoleColumn);
	duplicateRoleColumn.clear();

	errorList = new ArrayList<ParsingError>();

	for (Entry<String, List<Integer>> roleEntry : columnRoles.entrySet()) {
		if (roleEntry.getValue().size() > 1 && !roleEntry.getKey().equals("attribute")) {
			errorList.add(new ParsingError(roleEntry.getValue(), ParsingError.ErrorCode.SAME_ROLE_FOR_MULTIPLE_COLUMNS,
					roleEntry.getKey()));
			duplicateRoleColumn.addAll(roleEntry.getValue());
		}
	}

	for (Entry<String, List<Integer>> nameEntry : columnNames.entrySet()) {
		if (nameEntry.getValue().size() > 1) {
			errorList.add(new ParsingError(nameEntry.getValue(), ParsingError.ErrorCode.SAME_NAME_FOR_MULTIPLE_COLUMNS,
					nameEntry.getKey()));
			duplicateNameColumn.addAll(nameEntry.getValue());
		}
	}
	checkIfUpdate();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:29,代码来源:MetaDataValidator.java

示例9: getErrorInRow

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public ParsingError getErrorInRow(int index) {
	if (index < errors.size()) {
		return errors.get(index);
	} else {
		return null;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:ErrorTableModel.java

示例10: getNumber

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
/**
 * This method is not supported by the XML result set. Anytime it is called a ParseException will be thrown.
 */
public Number getNumber(int columnIndex) throws ParseException {
    throw new ParseException(new ParsingError(currentExampleIndex, columnIndex, ParsingError.ErrorCode.UNPARSEABLE_REAL, ""));
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:8,代码来源:XMLResultSet.java

示例11: getDate

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
@Override
/**
 * This method is not supported by the XML result set. Anytime it is called a ParseException will be thrown.
 */
public Date getDate(int columnIndex) throws ParseException {
    throw new ParseException(new ParsingError(currentExampleIndex, columnIndex, ParsingError.ErrorCode.UNPARSEABLE_DATE, ""));
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:8,代码来源:XMLResultSet.java

示例12: getErrors

import com.rapidminer.operator.nio.model.ParsingError; //导入依赖的package包/类
public List<ParsingError> getErrors() {
	return errorList;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:MetaDataValidator.java


注:本文中的com.rapidminer.operator.nio.model.ParsingError类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。