1 package org.apache.commons.ognl; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 /** 23 * This interface defines some useful constants for describing the various possible numeric types of OGNL. 24 * 25 * @author Luke Blanshard (blanshlu@netscape.net) 26 * @author Drew Davidson (drew@ognl.org) 27 */ 28 public interface NumericTypes 29 { 30 // Order does matter here... see the getNumericType methods in ognl.g. 31 32 /** Type tag meaning boolean. */ 33 int BOOL = 0; 34 35 /** Type tag meaning byte. */ 36 int BYTE = 1; 37 38 /** Type tag meaning char. */ 39 int CHAR = 2; 40 41 /** Type tag meaning short. */ 42 int SHORT = 3; 43 44 /** Type tag meaning int. */ 45 int INT = 4; 46 47 /** Type tag meaning long. */ 48 int LONG = 5; 49 50 /** Type tag meaning java.math.BigInteger. */ 51 int BIGINT = 6; 52 53 /** Type tag meaning float. */ 54 int FLOAT = 7; 55 56 /** Type tag meaning double. */ 57 int DOUBLE = 8; 58 59 /** Type tag meaning java.math.BigDecimal. */ 60 int BIGDEC = 9; 61 62 /** Type tag meaning something other than a number. */ 63 int NONNUMERIC = 10; 64 65 /** 66 * The smallest type tag that represents reals as opposed to integers. You can see whether a type tag represents 67 * reals or integers by comparing the tag to this constant: all tags less than this constant represent integers, and 68 * all tags greater than or equal to this constant represent reals. Of course, you must also check for NONNUMERIC, 69 * which means it is not a number at all. 70 */ 71 int MIN_REAL_TYPE = FLOAT; 72 }