- 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 int
compareTo(Character searchCharacter)
boolean
equals(java.lang.Object obj)
int
getHeight()
Gets the height of the currentCharacter
.char
getLetter()
Gets the char letter of the currentCharacter
.int
getModifier()
Gets the modifier for the character.int
getWidth()
Gets the width of the currentCharacter
.int
getX()
Gets the X coordinate of the currentCharacter
.int
getY()
Gets the Y coordinate of the currentCharacter
.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)
boolean
isOverlappingY(Character searchCharacter)
void
setHeight(int height)
Sets the height of the currentCharacter
.void
setLetter(char letter)
Sets the char letter to the currentCharacter
.void
setModifier(int modifier)
Sets the modifier for the character.void
setWidth(int width)
Sets the width of the currentCharacter
.void
setX(int x)
Sets the X coordinate of the currentCharacter
.void
setY(int y)
Sets the Y coordinate of the currentCharacter
.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(Character searchCharacter)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Character>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-