View Javadoc

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