Class ReplaceSelector

  • All Implemented Interfaces:
    Selector

    public class ReplaceSelector
    extends java.lang.Object
    implements Selector
    Replace selector.
    Since:
    0.1.0
    Author:
    code4crafter@gmail.com
    • Constructor Summary

      Constructors 
      Constructor Description
      ReplaceSelector​(java.lang.String regexStr, java.lang.String replacement)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String select​(java.lang.String text)
      Extract single result in text.
      If there are more than one result, only the first will be chosen.
      java.util.List<java.lang.String> selectList​(java.lang.String text)
      Extract all results in text.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ReplaceSelector

        public ReplaceSelector​(java.lang.String regexStr,
                               java.lang.String replacement)
    • Method Detail

      • select

        public java.lang.String select​(java.lang.String text)
        Description copied from interface: Selector
        Extract single result in text.
        If there are more than one result, only the first will be chosen.
        Specified by:
        select in interface Selector
        Parameters:
        text - text
        Returns:
        result
      • selectList

        public java.util.List<java.lang.String> selectList​(java.lang.String text)
        Description copied from interface: Selector
        Extract all results in text.
        Specified by:
        selectList in interface Selector
        Parameters:
        text - text
        Returns:
        results
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object