KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > sqls > Value


1 /*
2  * Copyright 2003, 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.ws.jaxme.sqls;
18
19 /** <p>An abstract value.</p>
20  *
21  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
22  */

23 public interface Value {
24   public class Type {
25     private String JavaDoc name;
26     protected Type(String JavaDoc pName) {
27       name = pName;
28     }
29     public String JavaDoc toString() { return name; }
30     public String JavaDoc getName() { return name; }
31     public int hashCode() { return name.hashCode(); }
32     public boolean equals(Object JavaDoc o) {
33       return o != null && o instanceof Type &&
34           ((Type) o).name.equals(name);
35     }
36     public final static Type PLACEHOLDER = new Type("PLACEHOLDER");
37     public final static Type NULL = new Type("NULL");
38     public final static Type BOOLEAN = new Type("BOOLEAN");
39     public final static Type FLOAT = new Type("FLOAT");
40     public final static Type DOUBLE = new Type("DOUBLE");
41     public final static Type BYTE = new Type("BYTE");
42     public final static Type SHORT = new Type("SHORT");
43     public final static Type INT = new Type("INT");
44     public final static Type LONG = new Type("LONG");
45     public final static Type DATETIME = new Type("DATETIME");
46     public final static Type DATE = new Type("DATE");
47     public final static Type TIME = new Type("TIME");
48     public final static Type STRING = new Type("STRING");
49   }
50
51   /** <p>Returns the values type.</p>
52    */

53   public Type getType();
54
55   /** <p>Returns the actual value. This may be null.</p>
56    */

57   public Object JavaDoc getValue();
58 }
59
Popular Tags