KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > elementprocessor > impl > poi > hssf > elements > ConstraintType


1 /*
2  * Copyright 1999-2004 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.cocoon.components.elementprocessor.impl.poi.hssf.elements;
18
19
20
21 /**
22  * Contraint codes
23  *
24  * @author Marc Johnson (marc_johnson27591@hotmail.com)
25  * @version CVS $Id: ConstraintType.java 30932 2004-07-29 17:35:38Z vgritsenko $
26  */

27 public class ConstraintType
28 {
29     public static final int CONSTRAINT_TYPE_NONE = 0;
30     public static final int CONSTRAINT_TYPE_LESS_THAN = 1;
31     public static final int CONSTRAINT_TYPE_GREATER_THAN = 2;
32     public static final int CONSTRAINT_TYPE_EQUALS = 4;
33     public static final int CONSTRAINT_TYPE_INT = 8;
34     public static final int CONSTRAINT_TYPE_BOOL = 16;
35
36     private ConstraintType() {
37     }
38
39     /**
40      * Is this a valid constraint?
41      *
42      * @param val value to be checked
43      *
44      * @return true if valid, false otherwise
45      */

46
47     public static boolean isValid(final int val) {
48         switch (val) {
49             case CONSTRAINT_TYPE_NONE :
50             case CONSTRAINT_TYPE_LESS_THAN :
51             case CONSTRAINT_TYPE_GREATER_THAN :
52             case CONSTRAINT_TYPE_EQUALS :
53             case CONSTRAINT_TYPE_INT :
54             case CONSTRAINT_TYPE_BOOL :
55                 return true;
56             default :
57                 return false;
58         }
59     }
60 } // end public class ConstraintType
61
Popular Tags