1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.jdo.impl.model.java;
19
20 import org.apache.jdo.model.java.JavaType;
21
22 /***
23 * A ValueClassType instance represents a class whoses values may be treated
24 * as values rather than refernces during storing.
25 * <p>
26 * Class PredefinedType provides public static final variables referring
27 * to the JavaType representation for value class types.
28 *
29 * @see PredefinedType#numberType
30 * @see PredefinedType#stringType
31 * @see PredefinedType#localeType
32 * @see PredefinedType#bigDecimalType
33 * @see PredefinedType#bigIntegerType
34 *
35 * @author Michael Bouschen
36 * @since JDO 1.0.1
37 */
38 public class ValueClassType
39 extends PredefinedType
40 {
41 /*** The orderable property. */
42 private boolean orderable;
43
44 /***
45 * Constructor.
46 * @param clazz the Class instance representing the type
47 * @param superclass JavaType instance representing the superclass.
48 * @param orderable flag indicating whether this type is orderable.
49 */
50 public ValueClassType(Class clazz, JavaType superclass, boolean orderable)
51 {
52 super(clazz, superclass);
53 this.orderable = orderable;
54 }
55
56 /***
57 * Returns <code>true</code> if this JavaType represents a type whoses
58 * values may be treated as values rather than refernces during
59 * storing.
60 * @return <code>true</code> if this JavaType represents a value type;
61 * <code>false</code> otherwise.
62 */
63 public boolean isValue()
64 {
65 return true;
66 }
67
68 /***
69 * Returns <code>true</code> if this JavaType represents an orderable
70 * type as specified by JDO.
71 * @return <code>true</code> if this JavaType represents an orderable
72 * type; <code>false</code> otherwise.
73 */
74 public boolean isOrderable()
75 {
76 return orderable;
77 }
78
79 }