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