Source Code Cross Referenced for SampleViews.java in  » JMX » je » collections » ship » factory » 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.factory 
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:01 cwl Exp $
007:         */
008:
009:        package collections.ship.factory;
010:
011:        import com.sleepycat.collections.StoredSortedMap;
012:        import com.sleepycat.collections.StoredSortedValueSet;
013:        import com.sleepycat.collections.TupleSerialFactory;
014:
015:        /**
016:         * SampleViews defines the data bindings and collection views for the sample
017:         * database.
018:         *
019:         * @author Mark Hayes
020:         */
021:        public class SampleViews {
022:
023:            private StoredSortedMap partMap;
024:            private StoredSortedMap supplierMap;
025:            private StoredSortedMap shipmentMap;
026:            private StoredSortedMap shipmentByPartMap;
027:            private StoredSortedMap shipmentBySupplierMap;
028:            private StoredSortedMap supplierByCityMap;
029:
030:            /**
031:             * Create the data bindings and collection views.
032:             */
033:            public SampleViews(SampleDatabase db) {
034:
035:                // Use the TupleSerialFactory for a Serial/Tuple-based database
036:                // where marshalling interfaces are used.
037:                //
038:                TupleSerialFactory factory = db.getFactory();
039:
040:                // Create map views for all stores and indices.
041:                // StoredSortedMap is used since the stores and indices are ordered
042:                // (they use the DB_BTREE access method).
043:                //
044:                partMap = factory.newSortedMap(db.getPartDatabase(),
045:                        PartKey.class, Part.class, true);
046:                supplierMap = factory.newSortedMap(db.getSupplierDatabase(),
047:                        SupplierKey.class, Supplier.class, true);
048:                shipmentMap = factory.newSortedMap(db.getShipmentDatabase(),
049:                        ShipmentKey.class, Shipment.class, true);
050:                shipmentByPartMap = factory.newSortedMap(db
051:                        .getShipmentByPartDatabase(), PartKey.class,
052:                        Shipment.class, true);
053:                shipmentBySupplierMap = factory.newSortedMap(db
054:                        .getShipmentBySupplierDatabase(), SupplierKey.class,
055:                        Shipment.class, true);
056:                supplierByCityMap = factory.newSortedMap(db
057:                        .getSupplierByCityDatabase(), String.class,
058:                        Supplier.class, true);
059:            }
060:
061:            // The views returned below can be accessed using the java.util.Map or
062:            // java.util.Set interfaces, or using the StoredMap and StoredValueSet
063:            // classes, which provide additional methods.  The entity sets could be
064:            // obtained directly from the Map.values() method but convenience methods
065:            // are provided here to return them in order to avoid down-casting
066:            // elsewhere.
067:
068:            /**
069:             * Return a map view of the part storage container.
070:             */
071:            public StoredSortedMap getPartMap() {
072:
073:                return partMap;
074:            }
075:
076:            /**
077:             * Return a map view of the supplier storage container.
078:             */
079:            public StoredSortedMap getSupplierMap() {
080:
081:                return supplierMap;
082:            }
083:
084:            /**
085:             * Return a map view of the shipment storage container.
086:             */
087:            public StoredSortedMap getShipmentMap() {
088:
089:                return shipmentMap;
090:            }
091:
092:            /**
093:             * Return an entity set view of the part storage container.
094:             */
095:            public StoredSortedValueSet getPartSet() {
096:
097:                return (StoredSortedValueSet) partMap.values();
098:            }
099:
100:            /**
101:             * Return an entity set view of the supplier storage container.
102:             */
103:            public StoredSortedValueSet getSupplierSet() {
104:
105:                return (StoredSortedValueSet) supplierMap.values();
106:            }
107:
108:            /**
109:             * Return an entity set view of the shipment storage container.
110:             */
111:            public StoredSortedValueSet getShipmentSet() {
112:
113:                return (StoredSortedValueSet) shipmentMap.values();
114:            }
115:
116:            /**
117:             * Return a map view of the shipment-by-part index.
118:             */
119:            public StoredSortedMap getShipmentByPartMap() {
120:
121:                return shipmentByPartMap;
122:            }
123:
124:            /**
125:             * Return a map view of the shipment-by-supplier index.
126:             */
127:            public StoredSortedMap getShipmentBySupplierMap() {
128:
129:                return shipmentBySupplierMap;
130:            }
131:
132:            /**
133:             * Return a map view of the supplier-by-city index.
134:             */
135:            public StoredSortedMap getSupplierByCityMap() {
136:
137:                return supplierByCityMap;
138:            }
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.