Source Code Cross Referenced for RDFCollection.java in  » Rule-Engine » Mandarax » org » mandarax » rdf » 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 » Rule Engine » Mandarax » org.mandarax.rdf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:
019:        package org.mandarax.rdf;
020:
021:        import java.util.*;
022:        import com.hp.hpl.jena.rdf.model.RDFList;
023:        import com.hp.hpl.jena.rdf.model.RDFNode;
024:        import org.mandarax.kernel.ClauseSetException;
025:
026:        /**
027:         * RDFCollection is a wrapper for RDF Collections (RDF Linked List). 
028:         * @author <A HREF="mailto:paschke@in.tum.de">Adrian Paschke</A>
029:         * @version 1.1 <01 August 2004>
030:         * @since 1.1
031:         */
032:        public class RDFCollection implements  Collection, RDFLogger {
033:
034:            private RDFList delegate = null;
035:
036:            /**
037:             * Default constructor.
038:             * @param c the wrapped jena collection (RDFList)	 
039:             */
040:            public RDFCollection(RDFList c) throws ClauseSetException {
041:                super ();
042:                delegate = c;
043:            }
044:
045:            /**
046:             * Returns an iterator over the elements in the internal collection.
047:             * @return an Iterator over the elements in the internal collection.
048:             */
049:            public Iterator iterator() {
050:                return delegate.iterator();
051:            }
052:
053:            /**
054:             * Returns the number of elements in the internal collection. 
055:             * @return the number of elements in the internal collection.
056:             */
057:            public int size() {
058:                return delegate.size();
059:            }
060:
061:            /**
062:             * Adds the specified element to the collection. 
063:             * Not supported, this is a "read only" view on a container. 
064:             * @param o the element to be added to the collection. 
065:             * @return true if the collection changed as a result of the call. 
066:             */
067:            public boolean add(Object o) {
068:                throw new UnsupportedOperationException(
069:                        "This is an unmodifiable collection");
070:            }
071:
072:            /**
073:             * Adds all of the elements in the specified collection to this collection.
074:             * @param col the elements to be inserted into the collection.
075:             * @return true if the collection changed as a result of the call. 
076:             */
077:            public boolean addAll(Collection col) {
078:                throw new UnsupportedOperationException(
079:                        "This is an unmodifiable collection");
080:            }
081:
082:            /**
083:             * Retains only the elements in the collection that are contained in the specified collection. 
084:             * @param col the elements to be retained in the collection.
085:             * @return true if the collection changed as a result of the call. 
086:             */
087:            public boolean retainAll(Collection col) {
088:                throw new UnsupportedOperationException(
089:                        "This is an unmodifiable collection");
090:            }
091:
092:            /**
093:             * Removes all the collection's elements that are also contained in the specified collection.  
094:             * @param col the elements to be removed from this collection.
095:             * @return true if the collection changed as a result of the call. 
096:             */
097:            public boolean removeAll(Collection col) {
098:                throw new UnsupportedOperationException(
099:                        "This is an unmodifiable collection");
100:            }
101:
102:            /**
103:             * Returns true if this collection contains all of the elements in the specified collection. 
104:             * Not yet supported (but could be done), would enforce initializing the entire collections. 
105:             * @param col the collection to be checked for containment in the internal collection.
106:             * @return true if this collection contains all of the elements in the specified collection.  
107:             */
108:            public boolean containsAll(Collection col) {
109:                throw new UnsupportedOperationException(
110:                        "This operation is not supported");
111:            }
112:
113:            /**
114:             * Returns true if this collection contains the specified element.   
115:             * @param o the element whose presence in this collection is to be tested.
116:             * @return true if this collection contains the specified element.  
117:             */
118:            public boolean contains(Object o) {
119:                return delegate.contains((RDFNode) o);
120:            }
121:
122:            /**
123:             * Removes all of the elements from the internal collection. 
124:             * This collection will be empty after this method returns unless it throws an exception.     
125:             */
126:            public void clear() {
127:                throw new UnsupportedOperationException(
128:                        "This is an unmodifiable collection");
129:            }
130:
131:            /**
132:             * Overwrite the equals method of the Collection Interface.  
133:             * @param o is the object the new method is invoked from.
134:             * @return the result of dispatching the new method represented by RDFContainer's method field on object o with parameters equal_value.
135:             * @throws Exception if the new method can not be invoked correctly.
136:             */
137:            public boolean equals(Object o) {
138:
139:                if (!super .equals(o)) {
140:
141:                    if (o instanceof  RDFCollection) {
142:                        return ((RDFCollection) o).sameListAs(delegate);
143:                    } else
144:                        return false;
145:                } else
146:                    return true;
147:            }
148:
149:            /**
150:             * Get the hash code for an object.
151:             * @return the hash code
152:             */
153:            public int hashCode() {
154:                return delegate == null ? 0 : delegate.hashCode();
155:            }
156:
157:            /**
158:             * Returns an array containing all of the elements in the collection.
159:             * Not yet supported, would enforge reading the entire collection.
160:             * @return an array containing all of the elements in this collection.    
161:             */
162:            public Object[] toArray() {
163:                throw new UnsupportedOperationException(
164:                        "This operation is not supported");
165:            }
166:
167:            /**
168:             * Returns true if this collection contains no elements.  
169:             * @return true if this collection contains no elements.    
170:             */
171:            public boolean isEmpty() {
172:                return delegate.size() == 0;
173:            }
174:
175:            /**
176:             * Removes a single instance of the specified element from the collection.
177:             * @param o the element to be removed from this collection, if present. 
178:             * @return true if this collection changed as a result of the call.    
179:             */
180:            public boolean remove(Object o) {
181:                throw new UnsupportedOperationException(
182:                        "This is an unmodifiable collection");
183:            }
184:
185:            /**
186:             * Returns an array containing all of the elements in this collection; 
187:             * the runtime type of the returned array is that of the specified array.
188:             * @param a the array into which the elements of this collection are to be stored, if it is big enough; 
189:             * otherwise, a new array of the same runtime type is allocated for this purpose.
190:             * @return an array containing the elements of this collection.   
191:             */
192:            public Object[] toArray(Object[] a) {
193:                throw new UnsupportedOperationException(
194:                        "This operation is not supported");
195:            }
196:
197:            /**
198:             * Answer true if this list has the same elements in the same order as the given list. 
199:             * Note that the standard equals test just tests for equality of two given list cells. 
200:             * While such a test is sufficient for many purposes, this test provides a broader equality definition, 
201:             * but is correspondingly more expensive to test. 
202:             * @param list a RDFList
203:             * @return true 
204:             */
205:            public boolean sameListAs(RDFList list) {
206:                return this.delegate.sameListAs(list);
207:            }
208:
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.