0,0 → 1,42 |
package dongfang.mkt.frames; |
|
import java.util.Formatter; |
import java.util.Locale; |
|
public class DCMMatrixResponseFrame extends ResponseFrame { |
private float[][] matrix; |
|
public DCMMatrixResponseFrame(int address) { |
super(address); |
} |
|
@Override |
public boolean isResponseTo(RequestFrame r) { |
return r instanceof DCMMatrixRequestFrame; |
} |
|
public float[][] getMatrix() { |
return matrix; |
} |
|
public void setMatrix(float[][] matrix) { |
this.matrix = matrix; |
} |
|
public String toString() { |
StringBuilder result = new StringBuilder(); |
Formatter fmt = new Formatter(result, Locale.US); |
fmt.format("%4.4f", matrix[0][0] + " "); |
fmt.format("%4.4f", matrix[0][1] + " "); |
fmt.format("%4.4f", matrix[0][2] + "\n"); |
|
fmt.format("%4.4f", matrix[1][0] + " "); |
fmt.format("%4.4f", matrix[1][1] + " "); |
fmt.format("%4.4f", matrix[1][2] + "\n"); |
|
fmt.format("%4.4f", matrix[2][0] + " "); |
fmt.format("%4.4f", matrix[2][1] + " "); |
fmt.format("%4.4f", matrix[2][2]); |
return result.toString(); |
} |
} |