Source Code Cross Referenced for Thing.java in  » Database-DBMS » perst » org » garret » 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 » Database DBMS » perst » org.garret.rdf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.garret.rdf;
002:
003:        import java.util.*;
004:        import java.io.*;
005:        import org.garret.perst.*;
006:
007:        /** 
008:         * Version of the object
009:         */
010:        public class Thing extends Persistent {
011:            /**
012:             * Object version history
013:             */
014:            public VersionHistory vh;
015:
016:            /**
017:             * Particular version of type of the object
018:             */
019:            public Thing type;
020:
021:            /**
022:             * Version creation timestamp
023:             */
024:            public Date timestamp;
025:
026:            /**
027:             * Property values
028:             */
029:            public PropVal[] props;
030:
031:            /**
032:             * Check if it is the latest version in version history
033:             * @return true if version is the last in version history
034:             */
035:            public boolean isLatest() {
036:                return vh.getLatest() == this ;
037:            }
038:
039:            /**
040:             * Get values of the property with given name
041:             * @param propName name of the proiperty
042:             */
043:            public Object[] get(String propName) {
044:                if (Symbols.Timestamp.equals(propName)) {
045:                    return new Object[] { timestamp };
046:                }
047:                ArrayList list = new ArrayList();
048:                for (int i = 0; i < props.length; i++) {
049:                    PropVal prop = props[i];
050:                    if (prop.def.name.equals(propName)) {
051:                        list.add(prop.val);
052:                    }
053:                }
054:                return list.toArray();
055:            }
056:
057:            /**
058:             * Check if object belongs to the partiular type
059:             * @param superType version history representing object type
060:             * @param kind search kind
061:             * @param timestamp timestamp used to locate version
062:             * @return true if type of the object is the same or is subtype of specified type
063:             */
064:            public boolean isInstanceOf(VersionHistory super Type,
065:                    SearchKind kind, Date timestamp) {
066:                return type.isSubTypeOf(super Type, kind, timestamp);
067:            }
068:
069:            /** This method is applicable only to objects represnting types and 
070:             * checks if this type is the same or subtype of specified type
071:             * @param superType version history representing object type
072:             * @param kind search kind
073:             * @param timestamp timestamp used to locate version
074:             * @return true if this type is the same or is subtype of specified type
075:             */
076:            public boolean isSubTypeOf(VersionHistory super Type,
077:                    SearchKind kind, Date timestamp) {
078:                if (vh == super Type) {
079:                    return true;
080:                }
081:                Object[] subtypes = get(Symbols.Subtype);
082:                for (int i = 0; i < subtypes.length; i++) {
083:                    VersionHistory subtype = (VersionHistory) subtypes[i];
084:                    if (kind == SearchKind.AllVersions) {
085:                        for (int j = subtype.versions.size(); --j >= 0;) {
086:                            Thing type = (Thing) subtype.versions.get(j);
087:                            if (type.isSubTypeOf(super Type, kind, timestamp)) {
088:                                return true;
089:                            }
090:                        }
091:                    } else {
092:                        Thing type = subtype.getVersion(kind, timestamp);
093:                        if (type != null
094:                                && type.isSubTypeOf(super Type, kind, timestamp)) {
095:                            return true;
096:                        }
097:                    }
098:                }
099:                return false;
100:            }
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.