KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > utility > ParameterInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * ParameterInfo
26  *
27  * Created on January 31, 2003
28  */

29
30 package com.sun.jdo.spi.persistence.utility;
31
32 //XXX FIXME This file may need to move under support/sqlstore.
33
public class ParameterInfo
34 {
35     /**
36      * Parameter index.
37      * The index corresponds to JDO QL parameters.
38      */

39     private final int index;
40
41     /** Parameter type. See FieldTypeEnumeration for possible values. */
42     private final int type;
43
44     /**
45      * Associated field to a parameter for runtime processing.
46      * This is defined if and only if the corresponding subfilter is of
47      * the form: field [relational op] _jdoParam or
48      * _jdoParam [relational op] field
49      * Otherwise, this is null.
50      */

51     private final String JavaDoc associatedField;
52
53     /** Constructor */
54     public ParameterInfo(int index, int type)
55     {
56         this(index, type, null);
57     }
58
59     /**
60      * Constructs a new ParameterInfo with the specified index, type and
61      * associatedField.
62      * @param index
63      * @param type
64      * @param associatedField
65      */

66     public ParameterInfo(int index, int type, String JavaDoc associatedField)
67     {
68         this.index = index;
69         this.type = type;
70         this.associatedField = associatedField;
71     }
72
73     /** Returns the parameter index. */
74     public int getIndex()
75     {
76         return index;
77     }
78
79     /** Returns the parameter type. See FieldTypeEnumeration for possible values. */
80     public int getType()
81     {
82         return type;
83     }
84
85     /**
86      * @returns the associated field.
87      */

88     public String JavaDoc getAssociatedField()
89     {
90         return associatedField;
91     }
92 }
93
Popular Tags