Salome HOME
a386b6d3e5cbdb79edce2b61b396f116ff1ee5b2
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / IDBuilder.java
1 package org.splat.dal.bo.som;
2
3 /**
4  * 
5  * @author    Daniel Brunier-Coulin
6  * @copyright OPEN CASCADE 2012-2015
7  */
8
9 import java.text.SimpleDateFormat;
10 import java.util.Date;
11
12 public class IDBuilder {
13
14         @SuppressWarnings("unused")
15         private int cycle;
16         private int base; // Number of studies created in this cycle
17
18         // ==============================================================================================================================
19         // Constructors
20         // ==============================================================================================================================
21
22         protected IDBuilder() {
23         }
24
25         public IDBuilder(Date date) {
26                 // -------------------------------
27                 SimpleDateFormat get = new SimpleDateFormat("yyyy");
28                 String year = get.format(date);
29                 cycle = Integer.valueOf(year);
30                 base = 0;
31         }
32
33         /**
34          * Get the base.
35          * 
36          * @return the base
37          */
38         public int getBase() {
39                 return base;
40         }
41
42         /**
43          * Set the base.
44          * 
45          * @param base
46          *            the base to set
47          */
48         public void setBase(int base) {
49                 this.base = base;
50         }
51 }