Package java.util.regex

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


        //  $PRESRR = 1 if( s#PRESRR/?\s+## ) ;
        m = MP.PRESRR.matcher(remark);
        if (m.find()) {
            field.put("Pressure_Rising_Rapidly", "Yes");
            unit.put("Pressure_Rising_Rapidly", "");
            remark = m.replaceFirst(" ");
        }

        //   Sector visibility
        //  if( s# (VIS|VSBY) (NE|NW|SE|SW|N|S|E|W)(\d1,3) (\d1,2)/(\d1,2)\s+## )
        //    $SectorVIS_DIR = padstr( $2, 2 ) ;
View Full Code Here


            var2 = Float.parseFloat(m.group(4));
            var3 = Float.parseFloat(m.group(5));
            var1 = var1 + (var2 / var3);
            field.put("Sector_Visibility", Float.toString(var1));
            unit.put("Sector_Visibility", "miles");
            remark = m.replaceFirst(" ");
            //   elsif( s#(VIS|VSBY) (NE|NW|SE|SW|N|S|E|W) (\d1,2)/(\d1,2)\s+## )
            //    $SectorVIS_DIR = padstr( $2, 2 ) ;
            //    $SectorVIS = ( $3 / $4 ) ;
        } else {
            m = MP.sectorVisibility2.matcher(remark);
View Full Code Here

                var1 = Float.parseFloat(m.group(3));
                var2 = Float.parseFloat(m.group(4));
                var1 = var1 / var2;
                field.put("Sector_Visibility", Float.toString(var1));
                unit.put("Sector_Visibility", "miles");
                remark = m.replaceFirst(" ");
                //     elsif( s#(VIS|VSBY) (NE|NW|SE|SW|N|S|E|W)(\d1,3)\s+## )
                //      $SectorVIS_DIR = padstr( $2, 2 ) ;
                //      $SectorVIS = $3 ;
            } else {
                m = MP.sectorVisibility3.matcher(remark);
View Full Code Here

                if (m.find()) {
                    field.put("Sector_Visibility_Direction", m.group(2));
                    unit.put("Sector_Visibility_Direction", "");
                    field.put("Sector_Visibility", m.group(3));
                    unit.put("Sector_Visibility", "miles");
                    remark = m.replaceFirst(" ");
                }
            }
        }

        //   Hailstone activity and size
View Full Code Here

        if (m.find()) {
            field.put("Hailstone_Activity", "yes");
            unit.put("Hailstone_Activity", "");
            field.put("Hailstone_Size", "0.25");
            unit.put("Hailstone_Size", "");
            remark = m.replaceFirst(" ");
            //   elsif( s# GR (\d1,3) (\d1,2)/(\d1,2)\s+## )
            //    $GR = 1 ;
            //    $GRsize = $1 + ( $2 / $3 ) ;
        } else {
            m = MP.GR2.matcher(remark);
View Full Code Here

                var2 = Float.parseFloat(m.group(2));
                var3 = Float.parseFloat(m.group(3));
                var1 = var1 + (var2 / var3);
                field.put("Hailstone_Size", Float.toString(var1));
                unit.put("Hailstone_Size", "");
                remark = m.replaceFirst(" ");
                //     elsif( s# GR (\d1,2)/(\d1,2)\s+## )
                //      $GR = 1 ;
                //      $GRsize = ( $1 / $2 ) ;
            } else {
                m = MP.GR3.matcher(remark);
View Full Code Here

                    var1 = Float.parseFloat(m.group(1));
                    var2 = Float.parseFloat(m.group(2));
                    var1 = var1 / var2;
                    field.put("Hailstone_Size", Float.toString(var1));
                    unit.put("Hailstone_Size", "");
                    remark = m.replaceFirst(" ");
                    //       elsif( s#GR (\d1,3)\s+## )
                    //        $GR = 1 ;
                    //        $GRsize = $1 ;
                } else {
                    m = MP.GR4.matcher(remark);
View Full Code Here

                    if (m.find()) {
                        field.put("Hailstone_Activity", "yes");
                        unit.put("Hailstone_Activity", "");
                        field.put("Hailstone_Size", m.group(1));
                        unit.put("Hailstone_Size", "");
                        remark = m.replaceFirst(" ");
                    }
                }
            }
        }
        //  $GR = 1 if( s# GS\s+## ) ;
View Full Code Here

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

        //   VIRGA activity
        //  if( s#VIRGA (DSNT )?(NE|NW|SE|SW|N|S|E|W)?\s+## )
        //    $VIRGA = 1 ;
View Full Code Here

            }
            if( m.group(2) != null ) {
                field.put("Virga_Direction", m.group(2));
                unit.put("Virga_Direction", "");
            }
            remark = m.replaceFirst(" ");
        }

        //   Surface-based Obscuring Phenomena  SfcObscuration weather conditions
        //   code table 4678
        //  if( s#-X(VC|PR)?(MI|BC|DR|BL|SH|TS|FZ)?(DZ|RA|SN|SG|IC|PE|PL|GR|GS|UP)?(BR|FG|FU|VA|DU|SA|HZ|PY)?(PO|SQ|FC|SS|DS)?(\d)\s+## )
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.