KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Direction codes
23  *
24  * @author Marc Johnson (marc_johnson27591@hotmail.com)
25  * @version CVS $Id: Direction.java 30932 2004-07-29 17:35:38Z vgritsenko $
26  */

27 public class Direction
28 {
29     public static final int DIRECTION_UNKNOWN = -1;
30     public static final int DIRECTION_UP_RIGHT = 0;
31     public static final int DIRECTION_UP_LEFT = 1;
32     public static final int DIRECTION_DOWN_RIGHT = 16;
33     public static final int DIRECTION_DOWN_LEFT = 17;
34
35     private Direction() {
36     }
37
38     /**
39      * Is this a valid direction?
40      *
41      * @param val value to be checked
42      *
43      * @return true if valid, false otherwise
44      */

45
46     public static boolean isValid(final int val) {
47         switch (val) {
48             case DIRECTION_UNKNOWN :
49             case DIRECTION_UP_RIGHT :
50             case DIRECTION_UP_LEFT :
51             case DIRECTION_DOWN_RIGHT :
52             case DIRECTION_DOWN_LEFT :
53                 return true;
54             default :
55                 return false;
56         }
57     }
58 } // end public class Direction
59
Popular Tags