public class Address extends Object implements Comparable<Address>, Serializable
Modifier and Type | Field and Description |
---|---|
static char |
HIGHEST_CHAR
The highest character to be used in a column name
|
static char |
LOWEST_CHAR
The lowest character to be used in a column name
|
Constructor and Description |
---|
Address(int column,
int row)
Creates a new address from the given column and row indices.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Address address)
Compares this address with the given address for order.
|
boolean |
equals(Object other)
Returns whether the other object is an address with
the same column and row coordinates as this address.
|
int |
getColumn()
Returns the column of the address.
|
int |
getRow()
Returns the row of the address.
|
int |
hashCode()
Returns the hash code of the address.
|
String |
toString()
Returns a string representation of the address on the form "B22",
composed of the letter of the column and number of the row that
intersect to form the address.
|
public static final char LOWEST_CHAR
public static final char HIGHEST_CHAR
public Address(int column, int row)
column
- the column of the addressrow
- the row of the addresspublic int getColumn()
public int getRow()
public boolean equals(Object other)
public int hashCode()
public int compareTo(Address address)
compareTo
in interface Comparable<Address>
address
- the address to compared to