Module NewOCR

Class Character

    • Method Summary

      Modifier and Type Method Description
      int compareTo​(Character searchCharacter)  
      boolean equals​(java.lang.Object obj)  
      int getHeight()
      Gets the height of the current Character.
      char getLetter()
      Gets the char letter of the current Character.
      int getModifier()
      Gets the modifier for the character.
      int getWidth()
      Gets the width of the current Character.
      int getX()
      Gets the X coordinate of the current Character.
      int getY()
      Gets the Y coordinate of the current Character.
      int hashCode()  
      boolean isInBounds​(int x, int y)
      Gets if the given coordinate is within the bounds of this character.
      boolean isInXBounds​(int x)
      Gets if the given Y position is within the X bounds of the current character.
      boolean isInYBounds​(int y)
      Gets if the given Y position is within the Y bounds of the current character.
      boolean isOverlappingX​(Character searchCharacter)
      Gets if another Character is overlapping the current Character at all in the X axis.
      boolean isOverlappingY​(Character searchCharacter)
      Gets if another Character is overlapping the current Character at all in the X axis.
      void setHeight​(int height)
      Sets the height of the current Character.
      void setLetter​(char letter)
      Sets the char letter to the current Character.
      void setModifier​(int modifier)
      Sets the modifier for the character.
      void setWidth​(int width)
      Sets the width of the current Character.
      void setX​(int x)
      Sets the X coordinate of the current Character.
      void setY​(int y)
      Sets the Y coordinate of the current Character.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getX

        public int getX()
        Gets the X coordinate of the current Character.
        Returns:
        The X coordinate
      • setX

        public void setX​(int x)
        Sets the X coordinate of the current Character.
        Parameters:
        x - The X coordinate to set
      • getY

        public int getY()
        Gets the Y coordinate of the current Character.
        Returns:
        The Y coordinate
      • setY

        public void setY​(int y)
        Sets the Y coordinate of the current Character.
        Parameters:
        y - The Y coordinate to set
      • getWidth

        public int getWidth()
        Gets the width of the current Character.
        Returns:
        The width
      • setWidth

        public void setWidth​(int width)
        Sets the width of the current Character.
        Parameters:
        width - The width to set
      • getHeight

        public int getHeight()
        Gets the height of the current Character.
        Returns:
        The height
      • setHeight

        public void setHeight​(int height)
        Sets the height of the current Character.
        Parameters:
        height - The height to set
      • getLetter

        public char getLetter()
        Gets the char letter of the current Character.
        Returns:
        The letter (Will default to '0' if not found for whatever reason)
      • setLetter

        public void setLetter​(char letter)
        Sets the char letter to the current Character.
        Parameters:
        letter - The letter to set
      • getModifier

        public int getModifier()
        Gets the modifier for the character.
        Returns:
        The character's modifier
      • setModifier

        public void setModifier​(int modifier)
        Sets the modifier for the character.
        Parameters:
        modifier - The modifier to set
      • isOverlappingX

        public boolean isOverlappingX​(Character searchCharacter)
        Gets if another Character is overlapping the current Character at all in the X axis.
        Parameters:
        searchCharacter - The Character to check for overlapping
        Returns:
        If the given Character is overlapping the current Character
      • isOverlappingY

        public boolean isOverlappingY​(Character searchCharacter)
        Gets if another Character is overlapping the current Character at all in the X axis.
        Parameters:
        searchCharacter - The Character to check for overlapping
        Returns:
        If the given Character is overlapping the current Character
      • isInBounds

        public boolean isInBounds​(int x,
                                  int y)
        Gets if the given coordinate is within the bounds of this character.
        Parameters:
        x - The X coordinate to check
        y - The Y coordinate to check
        Returns:
        If the coordinate is within this character
      • isInYBounds

        public boolean isInYBounds​(int y)
        Gets if the given Y position is within the Y bounds of the current character.
        Parameters:
        y - The Y position to check
        Returns:
        If the given Y position is within the Y bounds of the current character
      • isInXBounds

        public boolean isInXBounds​(int x)
        Gets if the given Y position is within the X bounds of the current character.
        Parameters:
        x - The Y position to check
        Returns:
        If the given Y position is within the X bounds of the current character
      • toString

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

        public int compareTo​(Character searchCharacter)
        Specified by:
        compareTo in interface java.lang.Comparable<Character>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object