Class SingleMatchResult

  • All Implemented Interfaces:
    java.util.regex.MatchResult

    final class SingleMatchResult
    extends java.lang.Object
    implements java.util.regex.MatchResult
    MatchResult implementation that returns the nested string as a single matching result. This match result mimics matching of a single matching group with group index 0 (the one containing the whole expression).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String path  
    • Constructor Summary

      Constructors 
      Constructor Description
      SingleMatchResult​(java.lang.String path)
      Construct a match result matching the whole supplied path.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int end()  
      int end​(int group)  
      java.lang.String group()  
      java.lang.String group​(int group)  
      int groupCount()  
      int start()  
      int start​(int group)  
      private static java.lang.String stripMatrixParams​(java.lang.String path)
      Strip the matrix parameters from a path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • path

        private final java.lang.String path
    • Constructor Detail

      • SingleMatchResult

        public SingleMatchResult​(java.lang.String path)
        Construct a match result matching the whole supplied path.
        Parameters:
        path - matched path.
    • Method Detail

      • stripMatrixParams

        private static java.lang.String stripMatrixParams​(java.lang.String path)
        Strip the matrix parameters from a path.
        Returns:
        path stripped of matrix parameters.
      • start

        public int start()
        Specified by:
        start in interface java.util.regex.MatchResult
      • start

        public int start​(int group)
        Specified by:
        start in interface java.util.regex.MatchResult
      • end

        public int end()
        Specified by:
        end in interface java.util.regex.MatchResult
      • end

        public int end​(int group)
        Specified by:
        end in interface java.util.regex.MatchResult
      • group

        public java.lang.String group()
        Specified by:
        group in interface java.util.regex.MatchResult
      • group

        public java.lang.String group​(int group)
        Specified by:
        group in interface java.util.regex.MatchResult
      • groupCount

        public int groupCount()
        Specified by:
        groupCount in interface java.util.regex.MatchResult