| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.data; |
| 17 |
|
|
| 18 |
|
import static java.lang.String.valueOf; |
| 19 |
|
import static org.fest.util.Objects.HASH_CODE_PRIME; |
| 20 |
|
import static org.fest.util.Strings.concat; |
| 21 |
|
|
| 22 |
|
import javax.swing.JTable; |
| 23 |
|
|
| 24 |
|
|
| 25 |
|
@link |
| 26 |
|
|
| 27 |
|
@author |
| 28 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 9 |
Complexity Density: 0.5 |
|
| 29 |
|
public class TableCell { |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
public final int row; |
| 33 |
|
|
| 34 |
|
|
| 35 |
|
public final int column; |
| 36 |
|
|
| 37 |
|
|
| 38 |
|
@link |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@param |
| 47 |
|
@return |
| 48 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
124
|
public static TableCellBuilder row(int row) { return new TableCellBuilder(row); }... |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
@link |
| 53 |
|
|
| 54 |
|
@author |
| 55 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 56 |
|
public static class TableCellBuilder { |
| 57 |
|
private final int row; |
| 58 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 59 |
124
|
TableCellBuilder(int row) { this.row = row; }... |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
@link |
| 63 |
|
|
| 64 |
|
@param |
| 65 |
|
@return |
| 66 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 67 |
124
|
public TableCell column(int column) { return new TableCell(row, column); }... |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
@link |
| 72 |
|
@param |
| 73 |
|
@param |
| 74 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 75 |
132
|
protected TableCell(int row, int column) {... |
| 76 |
132
|
this.row = row; |
| 77 |
132
|
this.column = column; |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
@inheritDoc |
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 5 |
Complexity Density: 0.5 |
|
| 81 |
55
|
@Override public boolean equals(Object obj) {... |
| 82 |
44
|
if (this == obj) return true; |
| 83 |
1
|
if (obj == null) return false; |
| 84 |
1
|
if (!(obj instanceof TableCell)) return false; |
| 85 |
9
|
TableCell other = (TableCell) obj; |
| 86 |
1
|
if (row != other.row) return false; |
| 87 |
8
|
return column == other.column; |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
@inheritDoc |
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 91 |
2
|
@Override public int hashCode() {... |
| 92 |
2
|
int result = 1; |
| 93 |
2
|
result = HASH_CODE_PRIME * result + column; |
| 94 |
2
|
result = HASH_CODE_PRIME * result + row; |
| 95 |
2
|
return result; |
| 96 |
|
} |
| 97 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 98 |
13
|
@Override public String toString() {... |
| 99 |
13
|
return concat("[row=", valueOf(row), ", column=", valueOf(column), "]"); |
| 100 |
|
} |
| 101 |
|
} |