From: <jm_...@us...> - 2009-01-21 16:06:59
|
Revision: 4389 http://fudaa.svn.sourceforge.net/fudaa/?rev=4389&view=rev Author: jm_lacombe Date: 2009-01-21 16:06:25 +0000 (Wed, 21 Jan 2009) Log Message: ----------- DEBUG ecriture de la ligne d'eau initiale avec un entete contenant des intier sur plus de 4 caract?\195?\168res Modified Paths: -------------- trunk/fudaa_devel/dodico/src/org/fudaa/dodico/mascaret/Rubens1DPermWriter.java Modified: trunk/fudaa_devel/dodico/src/org/fudaa/dodico/mascaret/Rubens1DPermWriter.java =================================================================== --- trunk/fudaa_devel/dodico/src/org/fudaa/dodico/mascaret/Rubens1DPermWriter.java 2009-01-21 09:11:20 UTC (rev 4388) +++ trunk/fudaa_devel/dodico/src/org/fudaa/dodico/mascaret/Rubens1DPermWriter.java 2009-01-21 16:06:25 UTC (rev 4389) @@ -55,14 +55,14 @@ double[] abscisses = getAbscisse(sres.resultatsBiefs, imax); int nbVarSansX = sres.variables.length; int nbPasTemps= sres.pasTemps.length; - ligne4_ = " IMAX = "+to4Char(imax)+" NBBIEF= "+to4Char(nbBief); + ligne4_ = " IMAX = "+to5Char(imax)+" NBBIEF= "+to5Char(nbBief); lignesSections_ = new String[((nbBief-1) / 5)+1]; // 5 biefs par ligne for (int i = 0; i < lignesSections_.length; i++) { lignesSections_[i] = " I1,I2 ="; } for (int i = 0; i < nbBief; i++) { - lignesSections_[i / 5] +=" "+to4Char(numSectionOrigine[i])+" "+to4Char(numSectionFin[i]); + lignesSections_[i / 5] +=" "+to5Char(numSectionOrigine[i])+" "+to5Char(numSectionFin[i]); } DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(Locale.US); @@ -167,6 +167,10 @@ } if (nbColonne != 0) fw_.println(); } + private final static String to4ou5Char(int entier) { + if (entier <10000) return to4Char(entier); + else return to5Char(entier); + } private final static String to4Char(int entier) { String chaine = ""+entier; int nbChar = chaine.length(); @@ -184,6 +188,25 @@ return " NaN"; } } + private final static String to5Char(int entier) { + String chaine = ""+entier; + int nbChar = chaine.length(); + if (nbChar >5) { + return "*****"; + } else if (nbChar == 5) { + return chaine; + } else if (nbChar == 4) { + return " "+chaine; + } else if (nbChar == 3) { + return " "+chaine; + } else if (nbChar == 2) { + return " "+chaine; + } else if (nbChar == 1) { + return " "+chaine; + } else { + return " NaN"; + } + } /* private final static String to9Char(String chaine) { int nbChar = chaine.length(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |