svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extJCRS / src / org / gvsig / crs / persistence / CrsData.java @ 34007
History | View | Annotate | Download (3.13 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
|
34 |
* Campus Universitario s/n
|
35 |
* 02071 Alabacete
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 967 599 200
|
39 |
*/
|
40 |
|
41 |
package org.gvsig.crs.persistence; |
42 |
|
43 |
import java.util.Date; |
44 |
import java.util.Properties; |
45 |
|
46 |
import org.gvsig.utils.DateTime; |
47 |
|
48 |
|
49 |
/**
|
50 |
* Esta clase contiene los datos de un CRS que son utilizados
|
51 |
* por el mecanismo de persistencia para almacenar los CRSs
|
52 |
* recientemente utilizados.
|
53 |
*
|
54 |
* @author Diego Guerrero Sevilla diego.guerrero@uclm.es
|
55 |
*/
|
56 |
public class CrsData implements Comparable{ |
57 |
|
58 |
private String authority = null; |
59 |
private int code = 0; |
60 |
private String name = null; |
61 |
private Date date = null; |
62 |
private Properties properies = new Properties(); |
63 |
|
64 |
|
65 |
|
66 |
public CrsData(String authority, int code, String name) { |
67 |
super();
|
68 |
// TODO Auto-generated constructor stub
|
69 |
this.authority = authority;
|
70 |
this.code = code;
|
71 |
this.name = name;
|
72 |
this.date = DateTime.getCurrentDate();
|
73 |
} |
74 |
|
75 |
public CrsData(String authority, int code, String name, Date date) { |
76 |
super();
|
77 |
// TODO Auto-generated constructor stub
|
78 |
this.authority = authority;
|
79 |
this.code = code;
|
80 |
this.name = name;
|
81 |
this.date = date;
|
82 |
} |
83 |
|
84 |
public CrsData() {
|
85 |
// TODO Auto-generated constructor stub
|
86 |
} |
87 |
|
88 |
public String getAuthority() { |
89 |
return authority;
|
90 |
} |
91 |
|
92 |
public int getCode() { |
93 |
return code;
|
94 |
} |
95 |
|
96 |
public String getName() { |
97 |
return name;
|
98 |
} |
99 |
|
100 |
/**
|
101 |
* @return Returns the properies.
|
102 |
*/
|
103 |
public Properties getProperies() { |
104 |
return properies;
|
105 |
} |
106 |
|
107 |
/**
|
108 |
* @param properies The properies to set.
|
109 |
*/
|
110 |
public void setProperies(Properties properies) { |
111 |
this.properies = properies;
|
112 |
} |
113 |
|
114 |
public void setAuthority(String authority) { |
115 |
this.authority = authority;
|
116 |
} |
117 |
|
118 |
public void setCode(int code) { |
119 |
this.code = code;
|
120 |
} |
121 |
|
122 |
public void setName(String name) { |
123 |
this.name = name;
|
124 |
} |
125 |
|
126 |
public Date getDate() { |
127 |
return date;
|
128 |
} |
129 |
|
130 |
public void updateLastAccess() { |
131 |
date = DateTime.getCurrentDate(); |
132 |
} |
133 |
|
134 |
public int compareTo(Object o) { |
135 |
CrsData crsData = (CrsData)o; |
136 |
return this.date.compareTo(crsData.getDate()); |
137 |
} |
138 |
} |