Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vinicius
committed
Jan 6, 2021
1 parent
7362305
commit 26a843a
Showing
11 changed files
with
130 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,47 @@ | ||
public class Bicicleta extends Veiculo { | ||
public class Bicicleta extends Veiculo implements Vendavel { | ||
|
||
private static float PRECO_DEFAULT = 500; | ||
|
||
private long codigoModelo; | ||
|
||
private int aro; | ||
|
||
private String marca; | ||
|
||
private float precoEmReais; | ||
|
||
public int getAro() { | ||
return aro; | ||
} | ||
|
||
public Bicicleta(long codigoModelo, int aro, String marca) { | ||
this.codigoModelo = codigoModelo; | ||
this.aro = aro; | ||
this.marca = marca; | ||
this.precoEmReais = PRECO_DEFAULT; | ||
} | ||
|
||
@Override | ||
public long getId() { | ||
return codigoModelo; | ||
} | ||
|
||
@Override | ||
public String getDescricao() { | ||
return String.format("Bicicleta %s aro %d", marca, aro); | ||
} | ||
|
||
@Override | ||
public float getPrecoEmReais() { | ||
return precoEmReais; | ||
} | ||
|
||
public void setPrecoEmReais(float precoEmReais) { | ||
this.precoEmReais = precoEmReais; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getDescricao(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
public class CD extends Produto { | ||
public class CD extends ArtigoCultural { | ||
|
||
private String nomeDoDisco; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
public class Caminhao extends Veiculo { | ||
|
||
private int numeroDeEixos; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
public class Livro extends Produto { | ||
public class Livro extends ArtigoCultural { | ||
|
||
private final int codigoISBN; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public interface Transportavel { | ||
|
||
String getDescricao(); | ||
|
||
int getPesoEmGramas(); | ||
|
||
int getVolumeEmCm3(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
public interface Vendavel { | ||
|
||
/** | ||
* @return um identificador único para este Vendável. | ||
*/ | ||
long getId(); | ||
|
||
/** | ||
* @return a descrição textual deste Vendável. | ||
*/ | ||
String getDescricao(); | ||
|
||
/** | ||
* @return o preço unitário, em reais, do Vendável. | ||
*/ | ||
float getPrecoEmReais(); | ||
} |