KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > queryexpression > queryspecification > topfunction


1 package com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.queryspecification;
2 import java.math.*;
3 import java.util.*;
4 import com.daffodilwoods.daffodildb.server.sql99.common.*;
5 import com.daffodilwoods.daffodildb.server.sql99.token.*;
6 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
7 import com.daffodilwoods.database.resource.*;
8
9 /**
10  * This class represents optional Top function of selectList. When Top function
11  * is speified, then only specific number of records defined in Top function are
12  * shown to user. If total number of rows are less than the number specified in
13  * top functions, then those rows are shown in resultant.
14  * e.g top(10) columname
15  * <p>Title: </p>
16  * <p>Description: </p>
17  * <p>Copyright: Copyright (c) 2004</p>
18  * <p>Company: </p>
19  * @author not attributable
20  * @version 1.0
21  */

22 public class topfunction implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter, Datatypes, _TOKEN, TypeConstants {
23   /**
24    * It represents right parenthesis ')' of top function
25    */

26   public Srightparen_1874859514 _Srightparen_18748595140;
27   /**
28    * It is integer number define in topFuction,represents number of record to be
29    * selected
30    */

31   public unsignedinteger _unsignedinteger1;
32   /**
33    * It represents right parenthesis ')' of top function
34    */

35    public Sleftparen653880241 _Sleftparen6538802412;
36    /**
37     * It represents top keyword of Top function.
38     */

39    public SNONRESERVEDWORD136444255 _SNONRESERVEDWORD1364442553;
40
41    /**
42     * Returns the number of records present in 'top function'.
43     * @param object
44     * @return
45     * @throws com.daffodilwoods.database.resource.DException
46     */

47
48    public Object JavaDoc run(Object JavaDoc object) throws com.daffodilwoods.database.resource.DException {
49       return _unsignedinteger1.run(null);
50    }
51
52    /**
53     * This function is needed by parser.
54     * @return
55     */

56
57    public int getType() {
58       return OTHERS;
59    }
60
61    public String JavaDoc toString() {
62       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
63       sb.append(" ");
64       sb.append(_SNONRESERVEDWORD1364442553);
65       sb.append(" ");
66       sb.append(_Sleftparen6538802412);
67       sb.append(" ");
68       sb.append(_unsignedinteger1);
69       sb.append(" ");
70       sb.append(_Srightparen_18748595140);
71       return sb.toString();
72    }
73
74    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
75       topfunction tempClass = new topfunction();
76       tempClass._Srightparen_18748595140 = (Srightparen_1874859514) _Srightparen_18748595140.clone();
77       tempClass._unsignedinteger1 = (unsignedinteger) _unsignedinteger1.clone();
78       tempClass._Sleftparen6538802412 = (Sleftparen653880241) _Sleftparen6538802412.clone();
79       tempClass._SNONRESERVEDWORD1364442553 = (SNONRESERVEDWORD136444255) _SNONRESERVEDWORD1364442553.clone();
80       return tempClass;
81    }
82 }
83
Popular Tags