Code with Finding: |
class HexArrayField {
/**
* Sets a new value.
*
* @param data the new value to set
*/
public void setValue(byte[] data) {
if (data == null) {
reset();
}
int cellCount = length;
if (data.length < cellCount) {
for (int i = 0; i < (cellCount - data.length); i++) {
removeCell();
}
} else if (data.length > cellCount) {
for (int i = 0; i < (data.length - cellCount); i++) {
addCell();
}
}
/*@ assert data.length == length; */
for (int i = 0; i < data.length; i++) {
/* (1) lcLbl, (2) lcHexLbl, (3) smallerButton, (4) largerButton. */
HexField tf = (HexField)getComponent(4 + i);
tf.setValue(data[i]);
}
}
}
|