41 |
* |
* |
42 |
* @author <a href="mailto:[email protected]">Stefan Alfons Krüger</a> |
* @author <a href="mailto:[email protected]">Stefan Alfons Krüger</a> |
43 |
*/ |
*/ |
44 |
public class AttributeMetaData implements Copyable<AttributeMetaData>{ |
public class AttributeMetadata implements Copyable<AttributeMetadata>{ |
45 |
static private final Logger LOGGER = Logger |
static private final Logger LOGGER = Logger |
46 |
.getLogger(AttributeMetaData.class); |
.getLogger(AttributeMetadata.class); |
47 |
protected Translation title = new Translation(); |
protected Translation title = new Translation(); |
48 |
protected Translation desc = new Translation(); |
protected Translation desc = new Translation(); |
49 |
protected boolean visible = false; |
protected boolean visible = false; |
51 |
protected int colIdx; |
protected int colIdx; |
52 |
|
|
53 |
/** |
/** |
54 |
* Creates an {@link AttributeMetaData} object with the following information |
* Creates an {@link AttributeMetadata} object with the following information |
55 |
* @param colIdx The column index of this attribute in the underlying table/dbf/etc... |
* @param colIdx The column index of this attribute in the underlying table/dbf/etc... |
56 |
* @param visible Shall this attribute be displayed or hidden from the user? |
* @param visible Shall this attribute be displayed or hidden from the user? |
57 |
* @param title {@link Translation} for Name |
* @param title {@link Translation} for Name |
58 |
* @param desc {@link Translation} for an attribute description |
* @param desc {@link Translation} for an attribute description |
59 |
* @param unit {@link String} of the unit that the information is in |
* @param unit {@link String} of the unit that the information is in |
60 |
*/ |
*/ |
61 |
public AttributeMetaData(final int colIdx, final Boolean visible, |
public AttributeMetadata(final int colIdx, final Boolean visible, |
62 |
final Translation title, final Translation desc, final String unit) { |
final Translation title, final Translation desc, final String unit) { |
63 |
|
|
64 |
this.colIdx = colIdx; |
this.colIdx = colIdx; |
73 |
} |
} |
74 |
|
|
75 |
/** |
/** |
76 |
* Creates a new visible {@link AttributeMetaData} with default (no) values. |
* Creates a new visible {@link AttributeMetadata} with default (no) values. |
77 |
*/ |
*/ |
78 |
public AttributeMetaData(final Integer col, final String defaultName) { |
public AttributeMetadata(final Integer col, final String defaultName) { |
79 |
this(col, true, new Translation(defaultName), new Translation(), ""); |
this(col, true, new Translation(defaultName), new Translation(), ""); |
80 |
} |
} |
81 |
|
|
82 |
/** Only used for {@link Copyable<AttributeMetaData>#copy()}**/ |
/** Only used for {@link Copyable<AttributeMetaData>#copy()}**/ |
83 |
private AttributeMetaData() { |
private AttributeMetadata() { |
84 |
} |
} |
85 |
|
|
86 |
public boolean isVisible() { |
public boolean isVisible() { |
121 |
} |
} |
122 |
|
|
123 |
@Override |
@Override |
124 |
public AttributeMetaData copyTo(AttributeMetaData amd) { |
public AttributeMetadata copyTo(AttributeMetadata amd) { |
125 |
getTitle().copyTo(amd.getTitle()); |
getTitle().copyTo(amd.getTitle()); |
126 |
getDesc().copyTo(amd.getDesc()); |
getDesc().copyTo(amd.getDesc()); |
127 |
amd.setUnit(getUnit()); |
amd.setUnit(getUnit()); |
132 |
} |
} |
133 |
|
|
134 |
@Override |
@Override |
135 |
public AttributeMetaData copy() { |
public AttributeMetadata copy() { |
136 |
AttributeMetaData amd = new AttributeMetaData(); |
AttributeMetadata amd = new AttributeMetadata(); |
137 |
getTitle().copyTo(amd.getTitle()); |
getTitle().copyTo(amd.getTitle()); |
138 |
getDesc().copyTo(amd.getDesc()); |
getDesc().copyTo(amd.getDesc()); |
139 |
amd.setUnit(getUnit()); |
amd.setUnit(getUnit()); |