1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.promotego.viewbeans;
20
21 import java.util.Date;
22
23 import org.promotego.beans.Location;
24 import org.promotego.beans.OfferedGame;
25 import org.promotego.beans.User;
26
27 public class OfferedGameViewBean implements Comparable<OfferedGameViewBean>
28 {
29 private OfferedGame m_offeredGame;
30 private double m_distance;
31
32 public double getDistance()
33 {
34 return m_distance;
35 }
36
37 public void setDistance(double distance)
38 {
39 m_distance = distance;
40 }
41
42 public float getDuration()
43 {
44 return m_offeredGame.getDuration();
45 }
46
47 public OfferedGame getOfferedGame()
48 {
49 return m_offeredGame;
50 }
51
52 public Location getLocation()
53 {
54 return m_offeredGame.getLocation();
55 }
56
57 public User getOfferer()
58 {
59 return m_offeredGame.getOfferer();
60 }
61
62 public Date getStartTime()
63 {
64 return m_offeredGame.getStartTime();
65 }
66
67 public void setOfferedGame(OfferedGame offeredGame)
68 {
69 m_offeredGame = offeredGame;
70 }
71
72 public Long getId()
73 {
74 return m_offeredGame.getId();
75 }
76
77 public int compareTo(OfferedGameViewBean otherBean)
78 {
79 return (int)Math.signum(getDistance() - otherBean.getDistance());
80 }
81 }