-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEstadaH.java
62 lines (48 loc) · 1.42 KB
/
EstadaH.java
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
62
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package proactiva;
import java.time.LocalDateTime;
import java.util.List;
/**
*
* @author narcisbustins
*/
public class EstadaH extends Activitat{ // no te durada fixada
private Allotjament hotel;
public EstadaH(int _durada, float _preu,Allotjament _hotel) {
super(0,_preu); //La durada no es sap
hotel = _hotel;
}
public String getCategoria(){
return hotel.getCategoria();
}
@Override
public PuntInteres piActual() {
return hotel;
}
@Override
int satisfaccio(List<String> preferenciesClients) {
int suma = 0;
List<String> llistaCaracteristiques = hotel.obtenirCaracteristiques();
for (String c:llistaCaracteristiques){
if (preferenciesClients.contains(c)) suma++;
}
return suma;
}
@Override
LocalDateTime hPropera(LocalDateTime hora) {
return hora;
}
@Override
public void mostraProva() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void mostrar() {
System.out.println(hotel.getNom());
super.mostrarHores();
}
}