View Javadoc
1   package fr.paris.lutece.plugins.aot.modules.declarationimmat.business;
2   
3   import java.sql.Timestamp;
4   import java.util.ArrayList;
5   import java.util.Calendar;
6   import java.util.HashMap;
7   import java.util.List;
8   import java.util.Map;
9   
10  public class PlaceGroup
11  {
12      private List<Place> _listPlaces = new ArrayList<>( );
13  
14      private List<Place> _listAvailablePlaces = new ArrayList<>( );
15  
16      private Timestamp _dateStartDate;
17  
18      private Timestamp _dateEndDate;
19  
20      private Integer _nAuthorizedCount = 0;
21  
22      private Map<TypeVehicle, Integer> _nCurrentCount = new HashMap<>( );
23  
24      private Integer _nAvailableCount = 0;
25  
26      private List<TypeVehicle> _typesVehicle;
27  
28      private String _strTypePlace;
29  
30      public PlaceGroup( )
31      {
32      }
33  
34      public PlaceGroup( PlaceGroup source )
35      {
36          _listPlaces = source._listPlaces;
37          _listAvailablePlaces = source._listAvailablePlaces;
38          _dateStartDate = source._dateStartDate;
39          _dateEndDate = source._dateEndDate;
40          _nAuthorizedCount = source._nAuthorizedCount;
41          _nCurrentCount = source._nCurrentCount;
42          _nAvailableCount = source._nAvailableCount;
43          _typesVehicle = source._typesVehicle;
44          _strTypePlace = source._strTypePlace;
45      }
46  
47      public List<Place> getPlaces( )
48      {
49          return _listPlaces;
50      }
51  
52      public void setPlaces( List<Place> listPlaces )
53      {
54          this._listPlaces = listPlaces;
55      }
56  
57      public Timestamp getStartDate( )
58      {
59          return _dateStartDate;
60      }
61  
62      public void setStartDate( Timestamp dateStartDate )
63      {
64          this._dateStartDate = dateStartDate;
65      }
66  
67      public void setStartDate( Calendar startDate )
68      {
69          setStartDate( toTimestamp( startDate ) );
70      }
71  
72      public Timestamp getEndDate( )
73      {
74          return _dateEndDate;
75      }
76  
77      public void setEndDate( Timestamp dateEndDate )
78      {
79          this._dateEndDate = dateEndDate;
80      }
81  
82      public void setEndDate( Calendar endDate )
83      {
84          setEndDate( toTimestamp( endDate ) );
85      }
86  
87      public Integer getAuthorizedCount( )
88      {
89          return _nAuthorizedCount;
90      }
91  
92      public void setAuthorizedCount( Integer authorizedCount )
93      {
94          _nAuthorizedCount = authorizedCount;
95      }
96  
97      public void incrementAuthorizedCount( )
98      {
99          _nAuthorizedCount++;
100     }
101 
102     public Map<TypeVehicle, Integer> getCurrentCount( )
103     {
104         return _nCurrentCount;
105     }
106 
107     public void setCurrentCount( Map<TypeVehicle, Integer> currentCount )
108     {
109         _nCurrentCount = currentCount;
110     }
111 
112     public void setAvailableCount( Integer availableCount )
113     {
114         _nAvailableCount = availableCount;
115     }
116 
117     public Integer getAvailableCount( )
118     {
119         return _nAvailableCount;
120     }
121 
122     public void incrementAvailableCount( )
123     {
124         _nAvailableCount++;
125     }
126 
127     public void decrementAvailableCount( int minus )
128     {
129         _nAvailableCount -= minus;
130 
131     }
132 
133     public List<Place> getAvailablePlaces( )
134     {
135         return _listAvailablePlaces;
136     }
137 
138     public void setAvailablePlaces( List<Place> availablePlaces )
139     {
140         this._listAvailablePlaces = availablePlaces;
141     }
142 
143     public List<TypeVehicle> getTypesVehicle( )
144     {
145         return _typesVehicle;
146     }
147 
148     public void setTypesVehicle( List<TypeVehicle> _typesVehicle )
149     {
150         this._typesVehicle = _typesVehicle;
151     }
152 
153     public String getTypePlace( )
154     {
155         return _strTypePlace;
156     }
157 
158     public void setTypePlace( String typePlace )
159     {
160         _strTypePlace = typePlace;
161     }
162 
163     private Timestamp toTimestamp( Calendar calendar )
164     {
165         return new Timestamp( calendar.getTimeInMillis( ) );
166     }
167 }