This repository was archived by the owner on Jun 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeam.java
More file actions
61 lines (51 loc) · 1.39 KB
/
Copy pathTeam.java
File metadata and controls
61 lines (51 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// =============================================================================
// Filename: Team.java ~ November 23, 2019
// =============================================================================
// Jaime Bohorquez
// Created using Atom + iTerm2 on Mac OS
// This program stores the Team class, that is able to instantiate a team object
// that can store the teams score, name, etc.
// =============================================================================
import java.util.*;
class Team implements Comparable<Team>
{
public Team next;
private int rank = -1;
private String plateNumber;
private String name;
private int score;
public Team(String name, String plateNumber, int score)
{
this.name = name;
this.plateNumber = plateNumber;
this.score = score;
}
// Getter method(s).
public String name()
{
return this.name;
}
public int score()
{
return this.score;
}
public int rank()
{
return this.rank;
}
public String plateNumber()
{
return this.plateNumber;
}
// Setter method(s).
public void setRank(int rank)
{
this.rank = rank;
}
// Implementation.
@Override
public int compareTo(Team t)
{
return this.plateNumber.compareTo(t.plateNumber);
}
}