Source Code Cross Referenced for MemStatement.java in  » RSS-RDF » sesame » org » openrdf » sail » memory » model » 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 » RSS RDF » sesame » org.openrdf.sail.memory.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
003:         *
004:         * Licensed under the Aduna BSD-style license.
005:         */
006:        package org.openrdf.sail.memory.model;
007:
008:        import org.openrdf.model.impl.ContextStatementImpl;
009:
010:        /**
011:         * A MemStatement is a Statement which contains context information and a flag
012:         * indicating whether the statement is explicit or inferred.
013:         */
014:        public class MemStatement extends ContextStatementImpl {
015:
016:            /*-----------*
017:             * Constants *
018:             *-----------*/
019:
020:            private static final long serialVersionUID = -3073275483628334134L;
021:
022:            /*-----------*
023:             * Variables *
024:             *-----------*/
025:
026:            /**
027:             * Flag indicating whether or not this statement has been added explicitly or
028:             * that it has been inferred.
029:             */
030:            private boolean explicit;
031:
032:            /**
033:             * Identifies the snapshot in which this statement was introduced.
034:             */
035:            private int sinceSnapshot;
036:
037:            /**
038:             * Identifies the snapshot in which this statement was revoked, defaults to
039:             * {@link Integer#MAX_VALUE}.
040:             */
041:            private int tillSnapshot = Integer.MAX_VALUE;
042:
043:            /**
044:             * Flag indicating the status of of this statement during a transaction.
045:             */
046:            private TxnStatus txnStatus;
047:
048:            /*--------------*
049:             * Constructors *
050:             *--------------*/
051:
052:            /**
053:             * Creates a new MemStatement with the supplied subject, predicate, object
054:             * and context and marks it as 'explicit'.
055:             */
056:            public MemStatement(MemResource subject, MemURI predicate,
057:                    MemValue object, MemResource context, int sinceSnapshot) {
058:                this (subject, predicate, object, context, true, sinceSnapshot);
059:            }
060:
061:            /**
062:             * Creates a new MemStatement with the supplied subject, predicate, object
063:             * and context and marks it as 'explicit'.
064:             */
065:            public MemStatement(MemResource subject, MemURI predicate,
066:                    MemValue object, MemResource context, boolean explicit,
067:                    int sinceSnapshot) {
068:                this (subject, predicate, object, context, explicit,
069:                        sinceSnapshot, TxnStatus.NEUTRAL);
070:            }
071:
072:            /**
073:             * Creates a new MemStatement with the supplied subject, predicate, object
074:             * and context. The value of the <tt>explicit</tt> parameter determines if
075:             * this statement is marked as 'explicit' or not.
076:             */
077:            public MemStatement(MemResource subject, MemURI predicate,
078:                    MemValue object, MemResource context, boolean explicit,
079:                    int sinceSnapshot, TxnStatus txnStatus) {
080:                super (subject, predicate, object, context);
081:                setExplicit(explicit);
082:                setSinceSnapshot(sinceSnapshot);
083:                setTxnStatus(txnStatus);
084:            }
085:
086:            /*---------*
087:             * Methods *
088:             *---------*/
089:
090:            @Override
091:            public MemResource getSubject() {
092:                return (MemResource) super .getSubject();
093:            }
094:
095:            @Override
096:            public MemURI getPredicate() {
097:                return (MemURI) super .getPredicate();
098:            }
099:
100:            @Override
101:            public MemValue getObject() {
102:                return (MemValue) super .getObject();
103:            }
104:
105:            @Override
106:            public MemResource getContext() {
107:                return (MemResource) super .getContext();
108:            }
109:
110:            public void setSinceSnapshot(int snapshot) {
111:                sinceSnapshot = snapshot;
112:            }
113:
114:            public int getSinceSnapshot() {
115:                return sinceSnapshot;
116:            }
117:
118:            public void setTillSnapshot(int snapshot) {
119:                tillSnapshot = snapshot;
120:            }
121:
122:            public int getTillSnapshot() {
123:                return tillSnapshot;
124:            }
125:
126:            public boolean isInSnapshot(int snapshot) {
127:                return snapshot >= sinceSnapshot && snapshot < tillSnapshot;
128:            }
129:
130:            public void setExplicit(boolean explicit) {
131:                this .explicit = explicit;
132:            }
133:
134:            public boolean isExplicit() {
135:                return explicit;
136:            }
137:
138:            public void setTxnStatus(TxnStatus txnStatus) {
139:                this .txnStatus = txnStatus;
140:            }
141:
142:            public TxnStatus getTxnStatus() {
143:                return txnStatus;
144:            }
145:
146:            /**
147:             * Lets this statement add itself to the appropriate statement lists of its
148:             * subject, predicate, object and context. The transaction status will be set
149:             * to {@link TxnStatus#NEW}.
150:             */
151:            public void addToComponentLists() {
152:                getSubject().addSubjectStatement(this );
153:                getPredicate().addPredicateStatement(this );
154:                getObject().addObjectStatement(this );
155:                MemResource context = getContext();
156:                if (context != null) {
157:                    context.addContextStatement(this );
158:                }
159:            }
160:
161:            /**
162:             * Lets this statement remove itself from the appropriate statement lists of
163:             * its subject, predicate, object and context. The transaction status will be
164:             * set to <tt>null</tt>.
165:             */
166:            public void removeFromComponentLists() {
167:                getSubject().removeSubjectStatement(this );
168:                getPredicate().removePredicateStatement(this );
169:                getObject().removeObjectStatement(this );
170:                MemResource context = getContext();
171:                if (context != null) {
172:                    context.removeContextStatement(this);
173:                }
174:            }
175:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.