001    package org.apache.commons.ognl;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    /**
023     * This interface defines some useful constants for describing the various possible numeric types of OGNL.
024     * 
025     * @author Luke Blanshard (blanshlu@netscape.net)
026     * @author Drew Davidson (drew@ognl.org)
027     */
028    public interface NumericTypes
029    {
030        // Order does matter here... see the getNumericType methods in ognl.g.
031    
032        /** Type tag meaning boolean. */
033        int BOOL = 0;
034    
035        /** Type tag meaning byte. */
036        int BYTE = 1;
037    
038        /** Type tag meaning char. */
039        int CHAR = 2;
040    
041        /** Type tag meaning short. */
042        int SHORT = 3;
043    
044        /** Type tag meaning int. */
045        int INT = 4;
046    
047        /** Type tag meaning long. */
048        int LONG = 5;
049    
050        /** Type tag meaning java.math.BigInteger. */
051        int BIGINT = 6;
052    
053        /** Type tag meaning float. */
054        int FLOAT = 7;
055    
056        /** Type tag meaning double. */
057        int DOUBLE = 8;
058    
059        /** Type tag meaning java.math.BigDecimal. */
060        int BIGDEC = 9;
061    
062        /** Type tag meaning something other than a number. */
063        int NONNUMERIC = 10;
064    
065        /**
066         * The smallest type tag that represents reals as opposed to integers. You can see whether a type tag represents
067         * reals or integers by comparing the tag to this constant: all tags less than this constant represent integers, and
068         * all tags greater than or equal to this constant represent reals. Of course, you must also check for NONNUMERIC,
069         * which means it is not a number at all.
070         */
071        int MIN_REAL_TYPE = FLOAT;
072    }