SHOW:
|
|
- or go back to the newest paste.
| 1 | ||
| 2 | ||
| 3 | public class Equipos implements Comparable<Equipos> {
| |
| 4 | //region Attributes. | |
| 5 | private String Nombre; | |
| 6 | private Integer Integrantes; | |
| 7 | private Integer Presas; | |
| 8 | //endregion. | |
| 9 | ||
| 10 | //region Constructors. | |
| 11 | public Equipos() {
| |
| 12 | } | |
| 13 | public Equipos(String name,Integer members,Integer fish) {
| |
| 14 | this.Nombre=name; | |
| 15 | this.Integrantes=members; | |
| 16 | this.Presas=fish; | |
| 17 | } | |
| 18 | //endregion. | |
| 19 | ||
| 20 | //region Getters and Setters | |
| 21 | public void setNombre(String name){
| |
| 22 | this.Nombre=name; | |
| 23 | } | |
| 24 | public String getNombre() {
| |
| 25 | return this.Nombre; | |
| 26 | } | |
| 27 | public void setIntegre(Integer members){
| |
| 28 | this.Integrantes=members; | |
| 29 | } | |
| 30 | public Integer getIntegre() {
| |
| 31 | return this.Integrantes; | |
| 32 | } | |
| 33 | public void setPresas(Integer fish){
| |
| 34 | this.Presas=fish; | |
| 35 | } | |
| 36 | public Integer getPresas(){
| |
| 37 | return this.Presas; | |
| 38 | } | |
| 39 | //endregion. | |
| 40 | ||
| 41 | public String toString() {
| |
| 42 | return "Nombre Del equipo " +Nombre + ", Integrantes: " + Integrantes + " Cantidad de Presas obtenidas: " +Presas; | |
| 43 | } | |
| 44 | @Override | |
| 45 | public int compareTo(Equipos o) {
| |
| 46 | // TODO Auto-generated method stub | |
| 47 | return (-1)*this.Presas.compareTo(o.getPresas()); | |
| 48 | } | |
| 49 | } | |
| 50 |