svn-gvsig-desktop / tags / v1_1_Build_1015 / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / values / LongValue.java @ 13679
History | View | Annotate | Download (2.05 KB)
1 |
package com.hardcode.gdbms.engine.values; |
---|---|
2 |
|
3 |
import java.sql.Types; |
4 |
|
5 |
|
6 |
|
7 |
/**
|
8 |
* Wrapper sobre el tipo long
|
9 |
*
|
10 |
* @author Fernando Gonz?lez Cort?s
|
11 |
*/
|
12 |
public class LongValue extends NumericValue { |
13 |
private long value; |
14 |
|
15 |
/**
|
16 |
* Creates a new LongValue object.
|
17 |
*
|
18 |
* @param value DOCUMENT ME!
|
19 |
*/
|
20 |
LongValue(long value) {
|
21 |
this.value = value;
|
22 |
} |
23 |
|
24 |
/**
|
25 |
* Creates a new LongValue object.
|
26 |
*/
|
27 |
LongValue() { |
28 |
} |
29 |
|
30 |
/**
|
31 |
* Establece el valor de este objeto
|
32 |
*
|
33 |
* @param value
|
34 |
*/
|
35 |
public void setValue(long value) { |
36 |
this.value = value;
|
37 |
} |
38 |
|
39 |
/**
|
40 |
* Obtiene el valor de este objeto
|
41 |
*
|
42 |
* @return
|
43 |
*/
|
44 |
public long getValue() { |
45 |
return value;
|
46 |
} |
47 |
|
48 |
/**
|
49 |
* @see java.lang.Object#toString()
|
50 |
*/
|
51 |
public String toString() { |
52 |
return "" + value; |
53 |
} |
54 |
|
55 |
/**
|
56 |
* @see com.hardcode.gdbms.engine.values.NumericValue#intValue()
|
57 |
*/
|
58 |
public int intValue() { |
59 |
return (int) value; |
60 |
} |
61 |
|
62 |
/**
|
63 |
* @see com.hardcode.gdbms.engine.values.NumericValue#longValue()
|
64 |
*/
|
65 |
public long longValue() { |
66 |
return (long) value; |
67 |
} |
68 |
|
69 |
/**
|
70 |
* @see com.hardcode.gdbms.engine.values.NumericValue#floatValue()
|
71 |
*/
|
72 |
public float floatValue() { |
73 |
return (float) value; |
74 |
} |
75 |
|
76 |
/**
|
77 |
* @see com.hardcode.gdbms.engine.values.NumericValue#doubleValue()
|
78 |
*/
|
79 |
public double doubleValue() { |
80 |
return (double) value; |
81 |
} |
82 |
|
83 |
/**
|
84 |
* DOCUMENT ME!
|
85 |
*
|
86 |
* @return DOCUMENT ME!
|
87 |
*/
|
88 |
public int getType() { |
89 |
return ValueFactory.LONG;
|
90 |
} |
91 |
|
92 |
/**
|
93 |
* @see com.hardcode.gdbms.engine.values.NumericValue#byteValue()
|
94 |
*/
|
95 |
public byte byteValue() { |
96 |
return (byte) value; |
97 |
} |
98 |
|
99 |
/**
|
100 |
* @see com.hardcode.gdbms.engine.values.NumericValue#shortValue()
|
101 |
*/
|
102 |
public short shortValue() { |
103 |
return (short) value; |
104 |
} |
105 |
|
106 |
/**
|
107 |
* @see com.hardcode.gdbms.engine.values.Value#getStringValue(com.hardcode.gdbms.engine.data.driver.ValueWriter)
|
108 |
*/
|
109 |
public String getStringValue(ValueWriter writer) { |
110 |
return writer.getStatementString(value);
|
111 |
} |
112 |
|
113 |
/**
|
114 |
* @see com.hardcode.gdbms.engine.values.Value#getSQLType()
|
115 |
*/
|
116 |
public int getSQLType() { |
117 |
return Types.BIGINT; |
118 |
} |
119 |
|
120 |
public int getWidth() { |
121 |
return 8; |
122 |
} |
123 |
} |