Newer
Older
package datastruct;
import java.util.ArrayList;
import java.util.List;
/**
* Represents a 2D integer coordinate used to specify positions in a grid.
*/
/**
* Creates a new {@link Coordinate} instance with the given {@code x} and {@code y} values.
*
* @param x The x-coordinate value.
* @param y The y-coordinate value.
* @return A new {@link Coordinate} instance.
*/
/**
* Computes and returns the {@link Coordinate} to the left of this one.
*
* @return The left adjacent {@link Coordinate}.
*/
/**
* Computes and returns the {@link Coordinate} to the right of this one.
*
* @return The right adjacent {@link Coordinate}.
*/
/**
* Computes and returns the {@link Coordinate} above this one.
*
* @return The above adjacent {@link Coordinate}.
*/
/**
* Computes and returns the {@link Coordinate} below this one.
*
* @return The below adjacent {@link Coordinate}.
*/
/**
* Computes and returns a list of orthogonal (adjacent in horizontal or vertical direction) neighbors.
*
* @return A list of orthogonal neighboring {@link Coordinate}s.
*/
/**
* Computes and returns a list of diagonal (adjacent in diagonal direction) neighbors.
*
* @return A list of diagonal neighboring {@link Coordinate}s.
*/
/**
* Computes and returns a list of all orthogonal and diagonal neighbors.
*
* @return A list of all neighboring {@link Coordinate}s.
*/