Methods Summary |
---|
public int | compareTo(java.lang.Object o)
Name n = (Name)o;
int lastCmp = lastName.compareTo(n.lastName);
return (lastCmp!=0 ? lastCmp :
firstName.compareTo(n.firstName));
|
public boolean | equals(java.lang.Object o)
if (!(o instanceof Name))
return false;
Name n = (Name)o;
return n.firstName.equals(firstName) &&
n.lastName.equals(lastName);
|
public java.lang.String | firstName()return firstName;
|
public int | hashCode()
return 31*firstName.hashCode() + lastName.hashCode();
|
public java.lang.String | lastName()return lastName;
|
public java.lang.String | toString()return firstName + " " + lastName;
|