Source Code Cross Referenced for LookupResult.java in  » Web-Server » Jigsaw » org » w3c » tools » resources » 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 » Web Server » Jigsaw » org.w3c.tools.resources 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // LookupResult.java
002:        // $Id: LookupResult.java,v 1.4 2000/11/09 12:48:15 ylafon Exp $
003:        // (c) COPYRIGHT MIT and INRIA, 1996.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.tools.resources;
007:
008:        /**
009:         * This class is the result of the lookup algorithm.
010:         */
011:        public class LookupResult {
012:            public static final int FILTERS_INIT_SIZE = 8;
013:            public static final int FILTERS_INCR = 4;
014:
015:            /**
016:             * Any reply that can be computed during lookup.
017:             */
018:            protected ReplyInterface reply = null;
019:            /**
020:             * The current target of the lookup operation.
021:             */
022:            protected ResourceReference target = null;
023:            /**
024:             * The current set of computed filters to be applied on the resource.
025:             */
026:            protected ResourceFilter filters[] = null;
027:            /**
028:             * The number of registered filters at this point.
029:             */
030:            protected int flength = -1;
031:
032:            /**
033:             * Get the current lookup target of the lookup in progress.	
034:             * @return An ResourceReference, that may be <strong>null</strong>.
035:             */
036:
037:            public ResourceReference getTarget() {
038:                return target;
039:            }
040:
041:            /**
042:             * Set the current target of the lookup operation.
043:             * @param target The new current target of the lookup in progress.
044:             */
045:            public void setTarget(ResourceReference target) {
046:                this .target = target;
047:            }
048:
049:            /**
050:             * Get the reply generated during the lookup.
051:             * @return A ReplyInterface instance.
052:             */
053:            public ReplyInterface getReply() {
054:                return reply;
055:            }
056:
057:            /**
058:             * Set the reply generated during the lookup.
059:             * @param reply A ReplyInterface instance.
060:             */
061:            public void setReply(ReplyInterface reply) {
062:                this .reply = reply;
063:            }
064:
065:            /**
066:             * Does this LookupResult has a Reply.
067:             * @return a boolean.
068:             */
069:            public boolean hasReply() {
070:                return reply != null;
071:            }
072:
073:            /**
074:             * Add a filter, to be invoked by the resource's <code>perform</code> 
075:             * method.
076:             * @param filter The HTTPFIlter to be called.
077:             */
078:            public void addFilter(ResourceFilter filter) {
079:                if (filters == null) {
080:                    // Create the filters array:
081:                    filters = new ResourceFilter[FILTERS_INIT_SIZE];
082:                    flength = 0;
083:                    filters[flength++] = filter;
084:                } else {
085:                    if (flength >= filters.length) {
086:                        // Resize the filters array:
087:                        ResourceFilter nf[] = new ResourceFilter[filters.length
088:                                + FILTERS_INCR];
089:                        System.arraycopy(filters, 0, nf, 0, filters.length);
090:                        filters = nf;
091:                    }
092:                    filters[flength++] = filter;
093:                }
094:                return;
095:            }
096:
097:            /**
098:             * Add a set of filters to be invoked by the resource's <code>
099:             * perform</code> method.
100:             * @param filters The array of filters to register.
101:             */
102:
103:            public void addFilters(ResourceFilter fs[]) {
104:                if (filters == null) {
105:                    flength = fs.length;
106:                    filters = new ResourceFilter[Math.max(FILTERS_INIT_SIZE,
107:                            flength)];
108:                    System.arraycopy(fs, 0, filters, 0, flength);
109:                } else {
110:                    int rs = flength + fs.length;
111:                    if (rs >= filters.length) {
112:                        int ns = Math.max(rs, filters.length + FILTERS_INCR);
113:                        ResourceFilter nf[] = new ResourceFilter[ns];
114:                        System.arraycopy(filters, 0, nf, 0, flength);
115:                        filters = nf;
116:                    }
117:                    System.arraycopy(fs, 0, filters, flength, fs.length);
118:                    flength += fs.length;
119:                }
120:                return;
121:            }
122:
123:            /**
124:             * Get the full list of filters to be applied when performing on the 
125:             * resource.
126:             * @return An array of ResourceFilter instances, or <strong>null</strong>
127:             * if none is defined.
128:             */
129:
130:            public ResourceFilter[] getFilters() {
131:                if (filters != null) {
132:                    // Fix the filter array size first:
133:                    if (filters.length != flength) {
134:                        ResourceFilter f[] = new ResourceFilter[flength];
135:                        System.arraycopy(filters, 0, f, 0, flength);
136:                        filters = f;
137:                    }
138:                }
139:                return filters;
140:            }
141:
142:            /**
143:             * Create a new empty lookup result object.
144:             * @param target The root target of the lookup operation to run.
145:             */
146:
147:            public LookupResult(ResourceReference target) {
148:                this.target = target;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.