Examples of replaceFirst()


Examples of java.util.regex.Matcher.replaceFirst()

                    maxtemp *= 0.1;
                }
                field.put("Max_Temperature", Double.toString( maxtemp ) );
                unit.put("Max_Temperature", "Celsius");
            }
            remark = m.replaceFirst(" ");
        }

        //   Minimum Temperature
        //  if( s# 2(0|1|/)(\d3|///)\s+# # )
        //    $Tmin = $2 / 10 if( $2 ne "///" ) ;
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

                    mintemp *= 0.1;
                }
                field.put("Min_Temperature", Double.toString( mintemp ) );
                unit.put("Min_Temperature", "Celsius");
            }
            remark = m.replaceFirst(" ");
        }
        //
        //   24-Hour Maximum and Minimum Temperature
        //  if( s# 4(0|1|/)(\d3|///)(0|1|/)(\d3|///)\s+# # )
        //    $Tmax24 = $2 / 10 if( $2 ne "///" ) ;
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

                    mintemp *= 0.1;
                }
                field.put("Min_Temperature_24Hour", Double.toString( mintemp ) );
                unit.put("Min_Temperature_24Hour", "Celsius");
            }
            remark = m.replaceFirst(" ");
        }
        //
        //   Presure Tendency
        //  if( s# 5(0|1|2|3|4|5|6|7|8)(\d3/?|///)\s+# # )
        //    $char_Ptend = $1 ;
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

            unit.put("Presure_Tendency_char", "");
            if( ! m.group(2).equals("///") ) {
                field.put("Presure_Tendency", Double.toString(Float.parseFloat(m.group(2)) * 0.1 ));
                unit.put("Presure_Tendency", "hectopascals");
            }
            remark = m.replaceFirst(" ");
        }

        //   Freezing Rain sensor not working  FZRANO
        //  $FZRANO = 1 if( s#FZRANO\s+## ) ;
        m = MP.FZRANO.matcher(remark);
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        //  $FZRANO = 1 if( s#FZRANO\s+## ) ;
        m = MP.FZRANO.matcher(remark);
        if (m.find()) {
            field.put("Freezing_Rain_sensor_working", "No");
            unit.put("Freezing_Rain_sensor_working", "");
            remark = m.replaceFirst(" ");
        }

        //   Tipping bucket rain gauge is inoperative.
        //  $PNO = 1 if( s#PNO\s+## ) ;
        m = MP.PNO.matcher(remark);
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        //  $PNO = 1 if( s#PNO\s+## ) ;
        m = MP.PNO.matcher(remark);
        if (m.find()) {
            field.put("Tipping_bucket_rain_gauge_working", "No");
            unit.put("Tipping_bucket_rain_gauge_working", "");
            remark = m.replaceFirst(" ");
        }

        //   Maintenance is needed on system Indicator
        //  $maintIndicator = 1 if( s#\$\s+## ) ;
        m = MP.maintenace.matcher(remark);
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        //  $maintIndicator = 1 if( s#\$\s+## ) ;
        m = MP.maintenace.matcher(remark);
        if (m.find()) {
            field.put("Maintenance_needed", "yes");
            unit.put("Maintenance_needed", "");
            remark = m.replaceFirst(" ");
        }

        /* let this go to the extra fields field cuz it's too general
//   Get Recent weather conditions with Beginning and Ending times, moved
//  because the RE are too general and they match wrongly
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        } // end for recent weather
*/
        //   Extra remarks includes Volcanic eruptions
        m = MP.spaces.matcher(remark);
        if (m.find()) {
            remark = m.replaceFirst("");
        }
        if( remark.length() != 0) {
            field.put("Extra_fields", remark );
            unit.put("Extra_fields", "");
        }
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        //  $NOSIG = 1 if( s#NOSIG## ) ;
        m = MP.NOSIG.matcher(report);
        if (m.find()) {
            field.put("Weather", "No");
            unit.put("Weather", "");
            report = m.replaceFirst(" ");
        }


        //   check for remarks or done
        if( remark == null)
View Full Code Here

Examples of java.util.regex.Matcher.replaceFirst()

        //   if( s#(A01|A01A|A02|A02A|AO1|AO1A|AO2|AO2A|AOA)\s+## ) ;
        m = MP.automatic_report.matcher(remark);
        if (m.find()) {
            field.put("Automatic_Report", m.group(1));
            unit.put("Automatic_Report", "");
            remark = m.replaceFirst(" ");
        }

        //  check if no more info in report
        if (MP.spaces.matcher(remark).matches()) {
            return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.