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.
Version:
1.0
Author:
Michael Miller - Truman State University
Since:
1.0

Field Summary

private int
color
private int
x
private int
y

Constructor Summary

Coordinate(int myX, int myY, int myColor)
Initializes the class with the given information.

Method Summary

int
getColor()
Accessor for color variable.
int
getX()
Accessor for X variable.
int
getY()
Accessor for Y variable.

Field Details

color

private int color

x

private int x

y

private int y

Constructor Details

Coordinate

public Coordinate(int myX,
                  int myY,
                  int myColor)
Initializes the class with the given information.

Pre: none
Post: This class is initialized.

Parameters:
myX - The x-coordinate of the pixel.
myY - The y-coordinate of the pixel.
myColor - The grayscale color value of the pixel.

Method Details

getColor

public int getColor()
Accessor for color variable.

Pre: This method is always safe on an instantianted class.
Post: No changes.

Returns:
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.

Returns:
x pixel coordinate value

getY

public int getY()
Accessor for Y variable.

Pre: This method is always safe on an instantianted class.
Post: No changes.

Returns:
y pixel coordinate value