Source Code Cross Referenced for CompassSearchResults.java in  » Search-Engine » compass-2.0 » org » compass » core » support » search » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » compass 2.0 » org.compass.core.support.search 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2006 the original author or authors.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.compass.core.support.search;
018:
019:        import org.compass.core.CompassHit;
020:
021:        /**
022:         * The results object returned by
023:         * {@link org.compass.core.support.search.CompassSearchHelper} when the search
024:         * operation on <code>Compass</code> is executed.
025:         * <p>
026:         * Holds the time it took to perform the search operation (in milliseconds), an
027:         * array of <code>CompassHit</code> (which might be all the hits, or only
028:         * paginated hits) and an array of <code>Page</code>s if using the pagination
029:         * feature.
030:         *
031:         * @author kimchy
032:         */
033:        public class CompassSearchResults {
034:
035:            /**
036:             * A class which holds the page data if using the pagination feature.
037:             *
038:             * @author kimchy
039:             */
040:            public static class Page {
041:                private int from;
042:
043:                private int to;
044:
045:                private int size;
046:
047:                private boolean selected;
048:
049:                /**
050:                 * Returns the hit number the page starts from.
051:                 */
052:                public int getFrom() {
053:                    return from;
054:                }
055:
056:                /**
057:                 * Sets the hit number the page starts from.
058:                 */
059:                public void setFrom(int from) {
060:                    this .from = from;
061:                }
062:
063:                /**
064:                 * Returns <code>true</code> if the page is selected, i.e. the results
065:                 * that are shown are part of the page.
066:                 */
067:                public boolean isSelected() {
068:                    return selected;
069:                }
070:
071:                /**
072:                 * Sets if the page is selected or not.
073:                 */
074:                public void setSelected(boolean selected) {
075:                    this .selected = selected;
076:                }
077:
078:                /**
079:                 * Returns the size of the hits in the page.
080:                 */
081:                public int getSize() {
082:                    return size;
083:                }
084:
085:                /**
086:                 * Sets the size of the hits in the page.
087:                 */
088:                public void setSize(int size) {
089:                    this .size = size;
090:                }
091:
092:                /**
093:                 * Returns the hit number that the page ends at.
094:                 */
095:                public int getTo() {
096:                    return to;
097:                }
098:
099:                /**
100:                 * Sets the hit number that the page ends at.
101:                 */
102:                public void setTo(int to) {
103:                    this .to = to;
104:                }
105:            }
106:
107:            private CompassHit[] hits;
108:
109:            private Page[] pages;
110:
111:            private long searchTime;
112:
113:            private int totalHits;
114:
115:            public CompassSearchResults(CompassHit[] hits, long searchTime,
116:                    int totalHits) {
117:                this .hits = hits;
118:                this .searchTime = searchTime;
119:                this .totalHits = totalHits;
120:            }
121:
122:            /**
123:             * Returns the hits that resulted from the search operation. Might hold all
124:             * the hits (not using pagination) or only the hits that belong to the
125:             * selected page (if using pagination).
126:             *
127:             * @return The hits
128:             */
129:            public CompassHit[] getHits() {
130:                return hits;
131:            }
132:
133:            /**
134:             * Returns the time that it took to perform the search operation (in
135:             * milliseconds).
136:             *
137:             * @return How long it took to perform the serarch in milli-seconds.
138:             */
139:            public long getSearchTime() {
140:                return searchTime;
141:            }
142:
143:            /**
144:             * Returns the total number of hits resulted from this search query.
145:             *
146:             * @return The total number of hits
147:             */
148:            public int getTotalHits() {
149:                return this .totalHits;
150:            }
151:
152:            /**
153:             * Returns the pages that construct all the results.
154:             *
155:             * @return The pages that holds all the results
156:             */
157:            public Page[] getPages() {
158:                return pages;
159:            }
160:
161:            /**
162:             * Sets the pages that contruct all the results.
163:             *
164:             * @param pages
165:             */
166:            public void setPages(Page[] pages) {
167:                this.pages = pages;
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.