Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.timesupport / org.gvsig.timesupport.lib / org.gvsig.timesupport.lib.impl / src / main / java / org / gvsig / timesupport / impl / DefaultEditableRelativeInstant.java @ 44136

History | View | Annotate | Download (2.52 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.timesupport.impl;
23

    
24
import org.joda.time.MutableDateTime;
25

    
26
import org.gvsig.timesupport.Chronology;
27
import org.gvsig.timesupport.EditableRelativeInstant;
28

    
29

    
30
/**
31
 * @author gvSIG Team
32
 * @version $Id$
33
 *
34
 */
35
public class DefaultEditableRelativeInstant extends DefaultRelativeInstant implements EditableRelativeInstant{
36
    private org.joda.time.MutableDateTime jodaMutableDateTime;
37

    
38
    DefaultEditableRelativeInstant(MutableDateTime jodaMutableDateTime, Chronology chronology) {
39
        super(jodaMutableDateTime.getMillis(), chronology);
40
        this.jodaMutableDateTime = jodaMutableDateTime;       
41
    }
42

    
43
    public void setTime(int hour, int minuteOfHour, int secondOfMinute,
44
        int millisOfSecond) {
45
        jodaMutableDateTime.setTime(hour, minuteOfHour, secondOfMinute, millisOfSecond); 
46
    }
47

    
48
    public void setDate(int year, int monthOfYear, int dayOfMonth) {
49
        jodaMutableDateTime.setDate(year, monthOfYear, dayOfMonth);        
50
    }
51

    
52
    public void addYears(int years) {
53
        jodaMutableDateTime.addYears(years);
54
    }
55

    
56
    public void addDays(int days) {
57
        jodaMutableDateTime.addDays(days);        
58
    }
59

    
60
    public void addHours(int hours) {
61
        jodaMutableDateTime.addHours(hours);        
62
    }
63

    
64
    public void addMinutes(int minutes) {
65
        jodaMutableDateTime.addMinutes(minutes);        
66
    }
67

    
68
    public void addSeconds(int seconds) {
69
        jodaMutableDateTime.addSeconds(seconds);        
70
    }
71

    
72
    public void addMillis(int millis) {
73
        jodaMutableDateTime.addMillis(millis);        
74
    }  
75
        
76
    public String toString() {      
77
        return jodaMutableDateTime.toString();
78
    }  
79
}