Package java.util.regex

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


        if (m.find()) {
            //field.put("SLPNO", "yes");
            //unit.put("SLPNO", "");
            field.put("Sea_Level_Pressure_available", "No");
            unit.put("Sea_Level_Pressure_available", "");           
            remark = m.replaceFirst(" ");
        }

        //if( s# SLP\s?(\d3)\s+## )
        m = MP.SLP.matcher(remark);
        if (m.find()) {
View Full Code Here


            } else {
                // $SLP =  $1 / 10. + 1000. ;
                field.put("Sea_Level_Pressure", Double.toString(Float.parseFloat(m.group(1)) * 0.1 + 1000));
            }
            unit.put("Sea_Level_Pressure", "hectopascal");
            remark = m.replaceFirst(" ");
        }
        //  check if no more info in report
        if (MP.spaces.matcher(remark).matches()) {
            return true;
        }
View Full Code Here

        //  $PRECIP_hourly = $1 / 100 if( s#P ?(\d1,5)\s+## ) ;
        m = MP.hourly_precip.matcher(remark);
        if (m.find()) {
            field.put("Hourly_Precipitation", Double.toString(Float.parseFloat(m.group(1)) * .01));
            unit.put("Hourly_Precipitation", "inches");
            remark = m.replaceFirst(" ");
        }

        //  check if no more info in report
        if (MP.spaces.matcher(remark).matches()) {
            return true;
View Full Code Here

        if (m.find()) {
            //field.put("PWINO", "");
            //unit.put("PWINO", "");
            field.put("PRECIP_sensor_working", "No");
            unit.put("PRECIP_sensor_working", "");
            remark = m.replaceFirst(" ");
        }

        //  check if no more info in report
        if (MP.spaces.matcher(remark).matches()) {
            return true;
View Full Code Here

        if (m.find()) {
            //field.put("TSNO", "yes");
            //unit.put("TSNO", "");
            field.put("Lightning_sensor_working", "No");
            unit.put("Lightning_sensor_working", "");
            remark = m.replaceFirst(" ");
        }

        //  check if no more info in report
        if (MP.spaces.matcher(remark).matches()) {
            return true;
View Full Code Here

        //  if( s#(TORNADO\w0,2|WATERSPOUTS*|FUNNEL CLOUDS*)\s+## )
        m = MP.tornado.matcher(remark);
        if (m.find()) {
            field.put("TornadicType", m.group(1));
            unit.put("TornadicType", "");
            remark = m.replaceFirst(" ");
            // if( s#(B|E)(\d\d)(\d\d)?\s+## )
            m = MP.tornadoTime.matcher(remark);
            if (m.find()) {
                String time;
                String units;
View Full Code Here

                     // $ETornadic_hh = $2 ;
                     //   $ETornadic_mm = $3 if( defined( $3 ) ) ;
                    field.put("End_Tornado", time);
                    unit.put("End_Tornado", units);
                }
                remark = m.replaceFirst(" ");
            }
            // $TornadicLOC = padstr( $1, 10 )
            //   if( s#^(DSNT|VCY STN|VC STN|VCY|VC)\s+## ) ;
            m = MP.tornadoLocation.matcher(remark);
            if (m.find()) {
View Full Code Here

            //   if( s#^(DSNT|VCY STN|VC STN|VCY|VC)\s+## ) ;
            m = MP.tornadoLocation.matcher(remark);
            if (m.find()) {
                field.put("Tornado_Location", m.group(1));
                unit.put("Tornado_Location", "");
                remark = m.replaceFirst(" ");
            }

             // $TornadicDIR = padstr( $1, 2 )
            //  if( s#^(NE|NW|SE|SW|N|S|E|W)\s+## ) ;
            m = MP.tornadoDirection.matcher(remark);
View Full Code Here

            //  if( s#^(NE|NW|SE|SW|N|S|E|W)\s+## ) ;
            m = MP.tornadoDirection.matcher(remark);
            if (m.find()) {
                field.put("Tornado_Direction", m.group(1));
                unit.put("Tornado_Direction", "");
                remark = m.replaceFirst(" ");
            }
        } // end tornado

        //   get Peak winds
        //  if( s#PK WND (\d3)(\d1,3)/(\d\d)?(\d\d)\s+## )
View Full Code Here

                 time = m.group(3) + m.group(4);
                 units = "hhmm";
            }
            field.put("Peak_Wind_Time", time );
            unit.put("Peak_Wind_Time", units );
            remark = m.replaceFirst(" ");
        }

        //   get Wind shift
        //  if( s#WSHFT (\d\d)?(\d\d)\s+## )
        m = MP.windShift.matcher(remark);
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.