Source Code Cross Referenced for ObjectID.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » core » 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 » Ozone 1.1 » org.ozoneDB.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // You can redistribute this software and/or modify it under the terms of
002:        // the Ozone Core License version 1 published by ozone-db.org.
003:        //
004:        // The original code and portions created by SMB are
005:        // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
006:        //
007:        // $Id: ObjectID.java,v 1.3 2002/06/08 00:49:38 mediumnet Exp $
008:
009:        package org.ozoneDB.core;
010:
011:        import java.io.*;
012:
013:        import org.ozoneDB.DxLib.DxCompatible;
014:        import org.ozoneDB.DxLib.DxObject;
015:
016:        public class ObjectID extends DxObject implements  Externalizable,
017:                Comparable {
018:
019:            final static long serialVersionUID = 2;
020:            final static byte subSerialVersionUID = 1;
021:
022:            private long value = -1;
023:
024:            public ObjectID() {
025:            }
026:
027:            /**
028:             * Constructor from a string representation aka a handle.
029:             *
030:             */
031:            public ObjectID(String handle) {
032:                value = Long.parseLong(handle);
033:            }
034:
035:            public ObjectID(long v) {
036:                value = v;
037:            }
038:
039:            public final long value() {
040:                return value;
041:            }
042:
043:            public final int hashCode() {
044:                //wenn diese 32 bits keinen unterschied mehr bringen,
045:                //wird mit equals() weiter verglichen
046:                return (int) value;
047:            }
048:
049:            public final boolean equals(Object obj) {
050:                if (this  == obj) {
051:                    return true;
052:                }
053:                if (obj != null && obj instanceof  ObjectID) {
054:                    return value == ((ObjectID) obj).value;
055:                }
056:                return false;
057:            }
058:
059:            public final boolean isLess(DxCompatible obj) {
060:                if (obj instanceof  ObjectID) {
061:                    return value < ((ObjectID) obj).value;
062:                }
063:                return false;
064:            }
065:
066:            public int compareTo(Object o) {
067:                return compareTo((ObjectID) o);
068:            }
069:
070:            /**
071:                Compares this ObjectID to the given ObjectID. This is useful for ozone objects which
072:                need a sort order but may not be equals. (E.g. for use in a {@link java.util.SortedSet}.)
073:
074:                @return
075:                    !=0 for ObjectIDs which are not equal
076:                    0 for ObjectIDs which are equal
077:             */
078:            public int comparTo(ObjectID o) {
079:                long diff = value() - o.value();
080:
081:                return diff > 0 ? 1 : diff < 0 ? -1 : 0;
082:            }
083:
084:            public Object clone() {
085:                return new ObjectID(value);
086:            }
087:
088:            public final void writeExternal(ObjectOutput out)
089:                    throws IOException {
090:                // env.logWriter.newEntry ("write: " + getClass().toString() + " " + value, LogWriter.DEBUG);
091:                out.writeByte(subSerialVersionUID);
092:                out.writeLong(value);
093:            }
094:
095:            public final void readExternal(ObjectInput in) throws IOException,
096:                    ClassNotFoundException {
097:                byte streamVersionUID = in.readByte();
098:                value = in.readLong();
099:                // env.logWriter.newEntry ("read: " + getClass().toString() + " " + value, LogWriter.DEBUG);
100:            }
101:
102:            /**
103:             * The value of the ObjectID as String. Do not change this, the name
104:             * of the cluster files depend on it.
105:             */
106:            public String toString() {
107:                return String.valueOf(value);
108:            }
109:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.