- java.lang.Object
-
- com.uddernetworks.newocr.character.Character
-
- All Implemented Interfaces:
java.lang.Comparable<Character>
- Direct Known Subclasses:
CoordinateCharacter,DatabaseCharacter,TrainedCharacterData
public abstract class Character extends java.lang.Object implements java.lang.Comparable<Character>
The superclass of all characters.- Since:
- April 25, 2019
-
-
Method Summary
Modifier and Type Method Description intcompareTo(Character searchCharacter)booleanequals(java.lang.Object obj)intgetHeight()Gets the height of the currentCharacter.chargetLetter()Gets the char letter of the currentCharacter.intgetModifier()Gets the modifier for the character.intgetWidth()Gets the width of the currentCharacter.intgetX()Gets the X coordinate of the currentCharacter.intgetY()Gets the Y coordinate of the currentCharacter.inthashCode()booleanisInBounds(int x, int y)Gets if the given coordinate is within the bounds of this character.booleanisInXBounds(int x)Gets if the given Y position is within the X bounds of the current character.booleanisInYBounds(int y)Gets if the given Y position is within the Y bounds of the current character.booleanisOverlappingX(Character searchCharacter)booleanisOverlappingY(Character searchCharacter)voidsetHeight(int height)Sets the height of the currentCharacter.voidsetLetter(char letter)Sets the char letter to the currentCharacter.voidsetModifier(int modifier)Sets the modifier for the character.voidsetWidth(int width)Sets the width of the currentCharacter.voidsetX(int x)Sets the X coordinate of the currentCharacter.voidsetY(int y)Sets the Y coordinate of the currentCharacter.java.lang.StringtoString()
-
-
-
Method Detail
-
getX
public int getX()
Gets the X coordinate of the currentCharacter.- Returns:
- The X coordinate
-
setX
public void setX(int x)
Sets the X coordinate of the currentCharacter.- Parameters:
x- The X coordinate to set
-
getY
public int getY()
Gets the Y coordinate of the currentCharacter.- Returns:
- The Y coordinate
-
setY
public void setY(int y)
Sets the Y coordinate of the currentCharacter.- Parameters:
y- The Y coordinate to set
-
getWidth
public int getWidth()
Gets the width of the currentCharacter.- Returns:
- The width
-
setWidth
public void setWidth(int width)
Sets the width of the currentCharacter.- Parameters:
width- The width to set
-
getHeight
public int getHeight()
Gets the height of the currentCharacter.- Returns:
- The height
-
setHeight
public void setHeight(int height)
Sets the height of the currentCharacter.- Parameters:
height- The height to set
-
getLetter
public char getLetter()
Gets the char letter of the currentCharacter.- 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 currentCharacter.- 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)
-
isOverlappingY
public boolean isOverlappingY(Character searchCharacter)
-
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 checky- 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:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(Character searchCharacter)
- Specified by:
compareToin interfacejava.lang.Comparable<Character>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-