當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。