Source Code Cross Referenced for SampleViews.java in  » JMX » je » collections » ship » basic » 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 » JMX » je » collections.ship.basic 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*-
002:         * See the file LICENSE for redistribution information.
003:         *
004:         * Copyright (c) 2002,2008 Oracle.  All rights reserved.
005:         *
006:         * $Id: SampleViews.java,v 1.14.2.2 2008/01/07 15:14:00 cwl Exp $
007:         */
008:
009:        package collections.ship.basic;
010:
011:        import com.sleepycat.bind.EntryBinding;
012:        import com.sleepycat.bind.serial.ClassCatalog;
013:        import com.sleepycat.bind.serial.SerialBinding;
014:        import com.sleepycat.collections.StoredEntrySet;
015:        import com.sleepycat.collections.StoredMap;
016:
017:        /**
018:         * SampleViews defines the data bindings and collection views for the sample
019:         * database.
020:         *
021:         * @author Mark Hayes
022:         */
023:        public class SampleViews {
024:
025:            private StoredMap partMap;
026:            private StoredMap supplierMap;
027:            private StoredMap shipmentMap;
028:
029:            /**
030:             * Create the data bindings and collection views.
031:             */
032:            public SampleViews(SampleDatabase db) {
033:
034:                // In this sample, the stored key and data entries are used directly
035:                // rather than mapping them to separate objects. Therefore, no binding
036:                // classes are defined here and the SerialBinding class is used.
037:                //
038:                ClassCatalog catalog = db.getClassCatalog();
039:                EntryBinding partKeyBinding = new SerialBinding(catalog,
040:                        PartKey.class);
041:                EntryBinding partDataBinding = new SerialBinding(catalog,
042:                        PartData.class);
043:                EntryBinding supplierKeyBinding = new SerialBinding(catalog,
044:                        SupplierKey.class);
045:                EntryBinding supplierDataBinding = new SerialBinding(catalog,
046:                        SupplierData.class);
047:                EntryBinding shipmentKeyBinding = new SerialBinding(catalog,
048:                        ShipmentKey.class);
049:                EntryBinding shipmentDataBinding = new SerialBinding(catalog,
050:                        ShipmentData.class);
051:
052:                // Create map views for all stores and indices.
053:                // StoredSortedMap is not used since the stores and indices are
054:                // ordered by serialized key objects, which do not provide a very
055:                // useful ordering.
056:                //
057:                partMap = new StoredMap(db.getPartDatabase(), partKeyBinding,
058:                        partDataBinding, true);
059:                supplierMap = new StoredMap(db.getSupplierDatabase(),
060:                        supplierKeyBinding, supplierDataBinding, true);
061:                shipmentMap = new StoredMap(db.getShipmentDatabase(),
062:                        shipmentKeyBinding, shipmentDataBinding, true);
063:            }
064:
065:            // The views returned below can be accessed using the java.util.Map or
066:            // java.util.Set interfaces, or using the StoredMap and StoredEntrySet
067:            // classes, which provide additional methods.  The entry sets could be
068:            // obtained directly from the Map.entrySet() method, but convenience
069:            // methods are provided here to return them in order to avoid down-casting
070:            // elsewhere.
071:
072:            /**
073:             * Return a map view of the part storage container.
074:             */
075:            public final StoredMap getPartMap() {
076:
077:                return partMap;
078:            }
079:
080:            /**
081:             * Return a map view of the supplier storage container.
082:             */
083:            public final StoredMap getSupplierMap() {
084:
085:                return supplierMap;
086:            }
087:
088:            /**
089:             * Return a map view of the shipment storage container.
090:             */
091:            public final StoredMap getShipmentMap() {
092:
093:                return shipmentMap;
094:            }
095:
096:            /**
097:             * Return an entry set view of the part storage container.
098:             */
099:            public final StoredEntrySet getPartEntrySet() {
100:
101:                return (StoredEntrySet) partMap.entrySet();
102:            }
103:
104:            /**
105:             * Return an entry set view of the supplier storage container.
106:             */
107:            public final StoredEntrySet getSupplierEntrySet() {
108:
109:                return (StoredEntrySet) supplierMap.entrySet();
110:            }
111:
112:            /**
113:             * Return an entry set view of the shipment storage container.
114:             */
115:            public final StoredEntrySet getShipmentEntrySet() {
116:
117:                return (StoredEntrySet) shipmentMap.entrySet();
118:            }
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.