|
From: <sa...@us...> - 2003-11-13 11:45:39
|
Update of /cvsroot/jrobin/src/org/jrobin/core
In directory sc8-pr-cvs1:/tmp/cvs-serv27498/org/jrobin/core
Modified Files:
DsDef.java FetchPoint.java Robin.java Sample.java Util.java
XmlWriter.java
Log Message:
Minor code changes
Index: DsDef.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/DsDef.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DsDef.java 10 Nov 2003 08:52:27 -0000 1.3
--- DsDef.java 13 Nov 2003 11:45:35 -0000 1.4
***************
*** 153,158 ****
public String dump() {
return "DS:" + dsName + ":" + dsType + ":" + heartbeat +
! ":" + Util.formatDouble(minValue, "U") +
! ":" + Util.formatDouble(maxValue, "U");
}
--- 153,158 ----
public String dump() {
return "DS:" + dsName + ":" + dsType + ":" + heartbeat +
! ":" + Util.formatDouble(minValue, "U", false) +
! ":" + Util.formatDouble(maxValue, "U", false);
}
Index: FetchPoint.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/FetchPoint.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FetchPoint.java 10 Nov 2003 08:52:27 -0000 1.2
--- FetchPoint.java 13 Nov 2003 11:45:35 -0000 1.3
***************
*** 93,97 ****
StringBuffer buffer = new StringBuffer(time + ": ");
for(int i = 0; i < values.length; i++) {
! buffer.append(Util.formatDouble(values[i]));
buffer.append(" ");
}
--- 93,97 ----
StringBuffer buffer = new StringBuffer(time + ": ");
for(int i = 0; i < values.length; i++) {
! buffer.append(Util.formatDouble(values[i], true));
buffer.append(" ");
}
Index: Robin.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/Robin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Robin.java 10 Nov 2003 08:52:27 -0000 1.2
--- Robin.java 13 Nov 2003 11:45:35 -0000 1.3
***************
*** 92,96 ****
int startPos = pointer.get();
for(int i = startPos; i < startPos + rows; i++) {
! buffer.append(Util.formatDouble(values.get(i % rows)) + " ");
}
buffer.append("\n");
--- 92,96 ----
int startPos = pointer.get();
for(int i = startPos; i < startPos + rows; i++) {
! buffer.append(Util.formatDouble(values.get(i % rows), true) + " ");
}
buffer.append("\n");
Index: Sample.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/Sample.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Sample.java 10 Nov 2003 08:52:27 -0000 1.3
--- Sample.java 13 Nov 2003 11:45:35 -0000 1.4
***************
*** 232,236 ****
for(int i = 0; i < values.length; i++) {
buffer.append(":");
! buffer.append(Util.formatDouble(values[i], "U"));
}
return buffer.toString();
--- 232,236 ----
for(int i = 0; i < values.length; i++) {
buffer.append(":");
! buffer.append(Util.formatDouble(values[i], "U", false));
}
return buffer.toString();
Index: Util.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/Util.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Util.java 10 Nov 2003 08:52:27 -0000 1.2
--- Util.java 13 Nov 2003 11:45:35 -0000 1.3
***************
*** 94,106 ****
}
! static String formatDouble(double x, String nanString) {
if(Double.isNaN(x)) {
return nanString;
}
! return df.format(x);
}
! static String formatDouble(double x) {
! return formatDouble(x, "" + Double.NaN);
}
--- 94,109 ----
}
! static String formatDouble(double x, String nanString, boolean forceExponents) {
if(Double.isNaN(x)) {
return nanString;
}
! if(forceExponents) {
! return df.format(x);
! }
! return "" + x;
}
! static String formatDouble(double x, boolean forceExponents) {
! return formatDouble(x, "" + Double.NaN, forceExponents);
}
Index: XmlWriter.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/core/XmlWriter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** XmlWriter.java 10 Nov 2003 08:52:27 -0000 1.2
--- XmlWriter.java 13 Nov 2003 11:45:35 -0000 1.3
***************
*** 66,74 ****
void writeTag(String tag, double value, String nanString) {
! writeTag(tag, Util.formatDouble(value, nanString));
}
void writeTag(String tag, double value) {
! writeTag(tag, Util.formatDouble(value));
}
--- 66,74 ----
void writeTag(String tag, double value, String nanString) {
! writeTag(tag, Util.formatDouble(value, nanString, true));
}
void writeTag(String tag, double value) {
! writeTag(tag, Util.formatDouble(value, true));
}
|