KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > javascript > ScriptPlacement


1 /*
2  * Copyright 2005 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  * $Header:$
17  */

18 package org.apache.beehive.netui.tags.javascript;
19
20 /**
21  *
22  */

23 public class ScriptPlacement
24 {
25     protected static final int INT_PLACE_BEFORE = 0;
26     protected static final int INT_PLACE_AFTER = 1;
27     protected static final int INT_PLACE_INLINE = 2;
28     protected static final int INT_PLACE_INFRAMEWORK = 3;
29     
30     public static final ScriptPlacement PLACE_BEFORE = new ScriptPlacement(INT_PLACE_BEFORE);
31     public static final ScriptPlacement PLACE_AFTER = new ScriptPlacement(INT_PLACE_AFTER);
32     public static final ScriptPlacement PLACE_INLINE = new ScriptPlacement(INT_PLACE_INLINE);
33     public static final ScriptPlacement PLACE_INFRAMEWORK = new ScriptPlacement(INT_PLACE_INFRAMEWORK);
34     
35     private int _val;
36     
37     private ScriptPlacement(int val)
38     {
39         _val = val;
40     }
41     
42     public String JavaDoc toString()
43     {
44         switch (_val)
45         {
46             case INT_PLACE_BEFORE : return "PLACE_BEFORE";
47             case INT_PLACE_AFTER: return "PLACE_AFTER";
48             case INT_PLACE_INLINE: return "PLACE_INLINE";
49             case INT_PLACE_INFRAMEWORK: return "PLACE_INFRAMEWORK";
50         }
51         
52         assert false : _val;
53         return "<unknown ScriptPlacement>";
54     }
55     
56     public boolean equals( Object JavaDoc o )
57     {
58         if (o == null) return false;
59         if (o == this) return true;
60         if (!(o instanceof ScriptPlacement)) return false;
61         return ((ScriptPlacement )o)._val == _val;
62     }
63     
64     public int hashCode()
65     {
66         return _val;
67     }
68 }
69
Popular Tags