Class Match

  • All Implemented Interfaces:
    Match

    public class Match
    extends Object
    implements Match
    Class representing a match.

    found = true, if a match has been detected

    if found = true then matchX and matchY represent the rounded coordinates of the center of the match

    • Constructor Detail

      • Match

        public Match​(boolean found)
        Constructor.
        Parameters:
        found - true, if a match has been detected
      • Match

        public Match​(boolean found,
                     int matchX,
                     int matchY)
        Constructor.
        Parameters:
        found - true, if a match has been detected
        matchX - x coordinate of the center of the match
        matchY - y coordinate of the center of the match
      • Match

        public Match​(boolean found,
                     int matchX,
                     int matchY,
                     byte[] visualization)
        Constructor.
        Parameters:
        found - true, if a match has been detected
        matchX - x coordinate of the center of the match
        matchY - y coordinate of the center of the match
        visualization - a Base64 encoded visualization image of the match
    • Method Detail

      • isFound

        public boolean isFound()
        Specified by:
        isFound in interface Match
      • setFound

        public void setFound​(boolean found)
        Specified by:
        setFound in interface Match
      • getX

        public int getX()
        Specified by:
        getX in interface Match
      • setX

        public void setX​(int matchX)
        Specified by:
        setX in interface Match
      • getY

        public int getY()
        Specified by:
        getY in interface Match
      • setY

        public void setY​(int matchY)
        Specified by:
        setY in interface Match
      • getVisualization

        public byte[] getVisualization()
        Specified by:
        getVisualization in interface Match
      • setVisualization

        public void setVisualization​(byte[] visualization)
        Specified by:
        setVisualization in interface Match
      • fromOccurrenceMatchingResult

        public static Match fromOccurrenceMatchingResult​(boolean found,
                                                         io.appium.java_client.imagecomparison.OccurrenceMatchingResult result,
                                                         double scalingFactor)
        Map a OccurrenceMatchingResult to a Match
        Parameters:
        found - has a match been found
        result - the OccurrenceMatchingResult
        scalingFactor - by how much has the image been scaled in regards to the original image (if a Match in regards to the scaled image is required this should be set to 1.0)
        Returns:
        Match
      • fromOccurrenceMatchingResult

        public static Match fromOccurrenceMatchingResult​(boolean found,
                                                         io.appium.java_client.imagecomparison.OccurrenceMatchingResult result)
        Map a OccurrenceMatchingResult to a Match
        Parameters:
        found - has a match been found
        result - the OccurrenceMatchingResult
        Returns:
        Match