1 /*
2 * This file is a part of CAST project.
3 * (c) Copyright 2007, AGH University of Science & Technology
4 * https://caribou.iisg.agh.edu.pl/trac/cast
5 *
6 * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.eclipse.org/legal/epl-v10.html
10 */
11 /*
12 * File: BrokenCellInfo.java
13 * Created: 2008-04-07
14 * Author: entrop
15 * $Id: BrokenCellInfo.java 2308 2009-01-12 22:33:45Z kpietak $
16 */
17
18 package pl.edu.agh.cast.rawdata.stat;
19
20 /**
21 *
22 * Class describes a single data cell which contains improper data. It contains associated broken row info object,
23 * column number and error info which describes improper data. If the error affects to whole row the column number is
24 * equal to <code>WHOLE_ROW_BROKEN</code> constant defined in BrokenRowInfo.
25 *
26 * @author AGH CAST Team
27 *
28 */
29 public class BrokenCellInfo {
30
31 /**
32 * Column index which indicates that broken cell affects whole row.
33 */
34 public static final int WHOLE_ROW_BROKEN = -1;
35
36 private BrokenRowInfo brokenRow;
37
38 private int column;
39
40 private ErrorInfo errorInfo;
41
42 // only package access
43 BrokenCellInfo(BrokenRowInfo row, int column, ErrorInfo error) {
44 this.brokenRow = row;
45 this.column = column;
46 this.errorInfo = error;
47 }
48
49 public BrokenRowInfo getBrokenRowInfo() {
50 return brokenRow;
51 }
52
53 public ErrorInfo getErrorInfo() {
54 return errorInfo;
55 }
56
57 public int getColumn() {
58 return column;
59 }
60
61 /**
62 *
63 * {@inheritDoc}
64 *
65 * @see java.lang.Object#toString()
66 */
67 @Override
68 public String toString() {
69 StringBuffer res = new StringBuffer();
70 res.append("[DataRow: ").append(getBrokenRowInfo().getSourceRow()) //$NON-NLS-1$
71 .append(", column: ").append(getColumn()).append(//$NON-NLS-1$
72 ", error type: ").append(getErrorInfo().getType()) //$NON-NLS-1$
73 .append("]"); //$NON-NLS-1$
74 return res.toString();
75 }
76 }