Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / values / IntValue.java @ 1956

History | View | Annotate | Download (1.61 KB)

1
package com.hardcode.gdbms.engine.values;
2

    
3
/**
4
 * Wrapper sobre el tipo int
5
 *
6
 * @author Fernando Gonz?lez Cort?s
7
 */
8
public class IntValue extends NumericValue {
9
        private int value;
10

    
11
        /**
12
         * Creates a new IntValue object.
13
         *
14
         * @param value DOCUMENT ME!
15
         */
16
        IntValue(int value) {
17
                this.value = value;
18
        }
19

    
20
        /**
21
         * Creates a new IntValue object.
22
         */
23
        IntValue() {
24
        }
25

    
26
        /**
27
         * Establece el valor de este objeto
28
         *
29
         * @param value
30
         */
31
        public void setValue(int value) {
32
                this.value = value;
33
        }
34

    
35
        /**
36
         * Obtiene el valor de este objeto
37
         *
38
         * @return
39
         */
40
        public int getValue() {
41
                return value;
42
        }
43

    
44
        /**
45
         * @see java.lang.Object#toString()
46
         */
47
        public String toString() {
48
                return "" + value;
49
        }
50

    
51
        /**
52
         * @see com.hardcode.gdbms.engine.values.NumericValue#intValue()
53
         */
54
        public int intValue() {
55
                return (int) value;
56
        }
57

    
58
        /**
59
         * @see com.hardcode.gdbms.engine.values.NumericValue#longValue()
60
         */
61
        public long longValue() {
62
                return (long) value;
63
        }
64

    
65
        /**
66
         * @see com.hardcode.gdbms.engine.values.NumericValue#floatValue()
67
         */
68
        public float floatValue() {
69
                return (float) value;
70
        }
71

    
72
        /**
73
         * @see com.hardcode.gdbms.engine.values.NumericValue#doubleValue()
74
         */
75
        public double doubleValue() {
76
                return (double) value;
77
        }
78

    
79
        /**
80
         * @see com.hardcode.gdbms.engine.values.NumericValue#getType()
81
         */
82
        public int getType() {
83
                return ValueFactory.INTEGER;
84
        }
85

    
86
        /**
87
         * @see com.hardcode.gdbms.engine.values.NumericValue#byteValue()
88
         */
89
        public byte byteValue() {
90
                return (byte) value;
91
        }
92

    
93
        /**
94
         * @see com.hardcode.gdbms.engine.values.NumericValue#shortValue()
95
         */
96
        public short shortValue() {
97
                return (short) value;
98
        }
99
}