vnt
Class Coordinate
(package private) class Coordinate
extends java.lang.Object
A class that holds the X,Y, and grayscale color value of a pixel.
Needed for the Stack class's Object manipulation requirements.
This class allows for the storage of invalid x and y coordinates.
- Michael Miller - Truman State University
private int | color
|
private int | x
|
private int | y
|
Coordinate(int myX, int myY, int myColor) - Initializes the class with the given information.
|
int | getColor() - Accessor for color variable.
|
int | getX() - Accessor for X variable.
|
int | getY() - Accessor for Y variable.
|
Coordinate
public Coordinate(int myX,
int myY,
int myColor)
Initializes the class with the given information.
Pre: none
Post: This class is initialized.
myX
- The x-coordinate of the pixel.myY
- The y-coordinate of the pixel.myColor
- The grayscale color value of the pixel.
getColor
public int getColor()
Accessor for color variable.
Pre: This method is always safe on an instantianted class.
Post: No changes.
- color grayscale color value
getX
public int getX()
Accessor for X variable.
Pre: This method is always safe on an instantianted class.
Post: No changes.
getY
public int getY()
Accessor for Y variable.
Pre: This method is always safe on an instantianted class.
Post: No changes.