Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
b09f345318baa9ca734e11c87f52f8522d7cc1fb
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package domain;

import java.io.Serializable;
import java.util.Date;
import java.util.Iterator;
import java.util.Vector;

public class RuralHouse implements Serializable {

	private static final long serialVersionUID = 1L;

	private String houseName;
	private String description;
	private Owner owner;
	private String district;
	private HouseFeatures features;
	public Vector<Offer> offers;


	public RuralHouse() {
		super();
	}

	public RuralHouse(String houseName, Owner owner, String description,
			String ds, HouseFeatures features) {
		this.houseName = houseName;
		this.description = description;
		this.owner = owner;
		this.district = ds;
		this.features = features;
		offers = new Vector<Offer>();
	}

	public String getHouseName() {
		return houseName;
	}

	public void setHouseName(String houseName) {
		this.houseName = houseName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Owner getOwner() {
		return owner;
	}

	public void setOwner(Owner owner) {
		this.owner = owner;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String ds) {
		this.district = ds;
	}

	public HouseFeatures getFeatures() {
		return features;
	}

	public void setFeatures(HouseFeatures features) {
		this.features = features;
	}

	public String toString() {
		return this.houseName + ": " + this.district;
	}

	public Offer createOffer(int offerNumber, Date firstDay, Date lastDay,
			float price) {
		Offer off = new Offer(offerNumber, this, firstDay, lastDay, price);
		offers.add(off);
		return off;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RuralHouse other = (RuralHouse) obj;
		if (houseName == null) {
			if (other.houseName != null)
				return false;
		} else if (!houseName.equals(other.houseName))
			return false;
		return true;
	}



	public Offer overlapsWith(Date firstDay, Date lastDay) {

		Iterator<Offer> e = offers.iterator();
		Offer offer = null;
		while (e.hasNext()) {
			offer = e.next();
			if ((offer.getFirstDay().compareTo(lastDay) < 0)
					&& (offer.getLastDay().compareTo(firstDay) > 0))
				return offer;
		}
		return null;

	}
	

	public Vector<Offer> getAllOffers() {

		return this.offers;
	}


}

Commits for RRRRHHHH_CoderuralHouses client/src/domain/RuralHouse.java

Diff revisions: vs.
Revision Author Commited Message
ccac99 ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:42:17 +0000

Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/domain/Owner.java
ruralHouses client/src/domain/RuralHouse.java
ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/dataAccess/DB4oManager.java
ruralHouses/src/domain/Booking.java

d30bcc ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:32:33 +0000

cleaning

fca164 ... Diff Diff camjan Tue 19 May, 2015 14:51:35 +0000

Some improvements done, owner deletion started, some bugs remain there

4f8bcc ... epinzolas001 Mon 18 May, 2015 09:49:54 +0000

Merge conflicts solutioned