Пример #1
0
 // Compares first by number and then by name.
 public int compareTo(Team other) {
   if (other == null) return -1;
   if (other.getNumber() != getNumber()) return getNumber() - other.getNumber();
   return getName().compareTo(other.getName());
 }
Пример #2
0
 // Checks for equality with the specified team.
 private boolean equals(Team team) {
   return team.getName().equals(getName()) && team.getNumber() == getNumber();
 }