View Javadoc

1   /*
2    * Copyright 2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at 
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software 
11   * distributed under the License is distributed on an "AS IS" BASIS, 
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License.
15   */
16  
17  package org.apache.jdo.impl.model.java;
18  
19  /***
20   * A IntegralType instance represents an integral type as defined in the
21   * Java language. There are five are integral types: <code>byte</code>, 
22   * <code>short</code>, <code>int</code>, <code>long</code>, and
23   * <code>char</code>.
24   * <p>
25   * Class PredefinedType provides public static final variables referring
26   * to the JavaType representation for integral types.
27   *
28   * @see PredefinedType#byteType
29   * @see PredefinedType#shortType
30   * @see PredefinedType#intType
31   * @see PredefinedType#longType
32   * @see PredefinedType#charType
33   *
34   * @author Michael Bouschen
35   * @since JDO 1.0.1
36   */
37  public class IntegralType
38      extends PrimitiveType 
39  {
40      /*** Constructor. */
41      public IntegralType(Class clazz)
42      {
43          super(clazz);
44      }
45      
46      /***
47       * Returns <code>true</code> if this JavaType represents an integral
48       * type. 
49       * @return <code>true</code> if this JavaTypre represents an integral
50       * type; <code>false</code> otherwise.
51       */
52      public boolean isIntegral() 
53      {
54          return true;
55      }
56  
57      /***
58       * Returns <code>true</code> if this JavaType represents an orderable
59       * type as specified by JDO.
60       * @return <code>true</code> if this JavaType represents an orderable
61       * type; <code>false</code> otherwise.
62       */
63      public boolean isOrderable() 
64      {
65          return true;
66      }
67  }