Vertex.java

package edu.hawaii.ics.yucheng;

/**
 * A vertex.
 */
final class Vertex {

    /** The x component. */
    public final int x;

    /** The y component. */
    public final int y;


    /**
     * Initializes a new instance of the class.
     * 
     * @param x The x component.
     * 
     * @param y The y component.
     */
    public Vertex(final int x, final int y) {
        this.x = x;
        this.y = y;
    }


    /**
     * Returns true if the vertex equals the specified value.
     * 
     * @param xx The x component.
     * 
     * @param yy The y component.
     * 
     * @return True indicates the x and y components are equal.
     */
    public boolean equals(final int xx, final int yy) {
        return xx == x && yy == y;
    }


    /**
     * Returns the string representation of the class data.
     * 
     * @return The string representation of the class data.
     */
    @Override
    public String toString() {
        return y + 1 + "," + (x + 1);
    }
}
Valid HTML 4.01 Valid CSS