public class GestionRepartoLocal {
// CÓDIGO DE APOYO
private ArrayList<Moto> motosDisponibles;
private ArrayList<Furgoneta> furgonetasDisponibles;
private ArrayList<Pedido> pedidosEsperandoMoto;
private ArrayList<Pedido> pedidosEsperandoFurgoneta;
//Con sus respectivos setter y getter para las listas
public void add(Transporte transporte){
//TO-DO
}
public void notificarEntregaPedido(Pedido pedido) {
//TO-DO
motosDisponibles.add(motosDisponibles.size(), pedido.getTransporte());
}
}
I can not find a way to find out if the transport type object (obtained from "order") is a Moto or Van class object. These last two are daughter classes of the transport class.
public class Transporte {
private String codigo;
private Mapa mapa;
public Transporte(String codTransporte, Mapa map) {
this.codigo = codTransporte;
this.mapa = map;
}
public double coste(String posDestino){
double costeTransporte = mapa.distancia(codigo, posDestino);
return costeTransporte;
}
public double coste(String cod1, String cod2) {
double costeTransporte = mapa.distancia(cod1, cod2);
return costeTransporte;
}
public String getCodigo(){
return codigo;
}
public Mapa getMapa() {
return mapa;
}
}
Thanks in advance to whoever answers. I am new writing in the forum, but not for that, I did not know the page. On previous occasions to answer questions and that were asked / answered by other users that helped me a lot.