Skip to content
Snippets Groups Projects
Commit 5b3ae4fa authored by victorm's avatar victorm
Browse files

Clases de Contenedor Acabadas

parent f3acadde
No related branches found
No related tags found
No related merge requests found
package es.markse;
/**
* Implementacion de la clase Estandar, que representa un contenedor Estandar
* @author javcalv
* @author victorm
*/
public class Estandar extends Contenedor {
public Estandar(ISO6346 codigo, float pesoTara, float maximaCargaUtil, float volumen, estados estadoActual,
......@@ -7,10 +11,12 @@ public class Estandar extends Contenedor {
super(codigo, pesoTara, maximaCargaUtil, volumen, estadoActual, pesoSeleccionado, volumenSeleccionado);
this.techo = techo;
}
@Override
public void anyadirTrayecto(Trayecto t) {
if (t==null) {
throw new IllegalArgumentException("h");
throw new IllegalArgumentException("El Trayecto no puede ser nulo");
}
if (this.trayectos.isEmpty()) {
this.anyadirTrayecto(t);
......
package es.markse;
/**
* Implementacion de la clase FlatRack, que representa un contenedor FlatRack
* @author javcalv
* @author victorm
*/
public class FlatRack extends Contenedor{
public FlatRack(ISO6346 codigo, float pesoTara, float maximaCargaUtil, float volumen, estados estadoActual,
......@@ -12,19 +16,19 @@ public class FlatRack extends Contenedor{
@Override
public void anyadirTrayecto(Trayecto t) {
if (t==null) {
throw new IllegalArgumentException("h");
throw new IllegalArgumentException("El Trayecto no puede ser nulo");
}
if (t instanceof TCamion) {
throw new IllegalArgumentException("No");
throw new IllegalArgumentException("No puede ser transportado en Camion");
}
if (t instanceof PackCamionBarco) {
throw new IllegalArgumentException("No");
throw new IllegalArgumentException("No puede ser transportado en Camion");
}
if (t instanceof PackCamionTren) {
throw new IllegalArgumentException("No");
throw new IllegalArgumentException("No puede ser transportado en Camion");
}
comprobarDatosContenedor(t);
......@@ -35,5 +39,4 @@ public class FlatRack extends Contenedor{
return false;
}
}
package es.markse;
/**
* Implementacion de la clase Refrigerado, que representa un contenedor Refrigerado
* @author javcalv
* @author victorm
*/
public class Refrigerado extends Contenedor{
public Refrigerado(ISO6346 codigo, float pesoTara, float maximaCargaUtil, float volumen, estados estadoActual,
......@@ -11,19 +15,15 @@ public class Refrigerado extends Contenedor{
@Override
public void anyadirTrayecto(Trayecto t) {
if (t==null) {
throw new IllegalArgumentException("h");
throw new IllegalArgumentException("El trayecto no puede ser nulo");
}
if (t instanceof TTren) {
throw new IllegalArgumentException("No");
}
if (t instanceof PackCamionBarco) {
throw new IllegalArgumentException("No");
throw new IllegalArgumentException("No puede viajar en tren");
}
if (t instanceof PackCamionTren) {
throw new IllegalArgumentException("No");
throw new IllegalArgumentException("No puede viajar en tren");
}
comprobarDatosContenedor(t);
......@@ -32,7 +32,6 @@ public class Refrigerado extends Contenedor{
@Override
public boolean tieneTecho() {
// TODO Auto-generated method stub
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment