Source Code Cross Referenced for ItemDO.java in  » J2EE » Enhydra-Demos » golfShop » data » item » 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 » J2EE » Enhydra Demos » golfShop.data.item 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server 
003:         * The Initial Developer of the Original Code is Lutris Technologies Inc. 
004:         * Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies
005:         * Inc. 
006:         * All Rights Reserved. 
007:         *
008:         * The contents of this file are subject to the Enhydra Public License Version
009:         * 1.0 (the "License"); you may not use this file except in compliance with the
010:         * License. You may obtain a copy of the License at
011:         * http://www.enhydra.org/software/license/epl.html 
012:         *
013:         * Software distributed under the License is distributed on an "AS IS" basis,
014:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
015:         * License for the specific language governing rights and limitations under the
016:         * License. 
017:         *
018:         * 
019:         */
020:
021:        package golfShop.data.item;
022:
023:        import java.util.Vector;
024:        import java.util.Enumeration;
025:
026:        /**
027:         * Individual items for sale.
028:         *
029:         * @author Scott Pirie
030:         * @version $Revision: 1.1 $
031:         */
032:        public class ItemDO implements  java.io.Serializable {
033:            /*----------------------------------------------------------------------*/
034:            // Class Data
035:            /*----------------------------------------------------------------------*/
036:            private static ItemStore storage = null;
037:
038:            /*----------------------------------------------------------------------*/
039:            // Class Methods
040:            /*----------------------------------------------------------------------*/
041:
042:            /*
043:             * Determine the store media selected for the category and item database
044:             */
045:
046:            public static void InitializeStorageOption(String opt, String dir) {
047:                try {
048:                    if (opt.equalsIgnoreCase("memory")) {
049:                        storage = new ItemStoreMemory();
050:                        storage.initializeItemStore();
051:                    } else if (opt.equalsIgnoreCase("file")) {
052:                        storage = new ItemStoreFile();
053:                        storage.initializeItemStore(dir);
054:                    } else {
055:                        storage = new ItemStoreMemory();
056:                        storage.initializeItemStore();
057:                    }
058:                } catch (Exception e) {
059:                }
060:
061:            }
062:
063:            /**
064:             * Constructor.  
065:             */
066:            protected ItemDO(long objectid, String SKU, double price,
067:                    String name, String desc) {
068:
069:                this .objectid = objectid;
070:                this .SKU = SKU;
071:                this .price = price;
072:                this .name = name;
073:                this .desc = desc;
074:            }
075:
076:            // TODO - delete this method
077:
078:            /*
079:             * Find the item with the given object id.
080:             */
081:            public static ItemDO getItemByObjectId(long objectId) {
082:
083:                return (storage.findItemInStore(objectId));
084:            }
085:
086:            /*----------------------------------------------------------------------*/
087:            // Instance Data
088:            /*----------------------------------------------------------------------*/
089:            private long objectid; // Application index
090:            private String SKU; // Corporate index
091:            private double price; // Item cost
092:            private String name; // Human-readable
093:            private String desc; // Description or location of desc
094:
095:            /*----------------------------------------------------------------------*/
096:            // Instance Methods
097:            /*----------------------------------------------------------------------*/
098:
099:            public long getObjectId() {
100:                return this .objectid;
101:            }
102:
103:            // This is a key so it shouldn't be changed by anyone.
104:            protected void setObjectId(long newId) {
105:                this .objectid = newId;
106:            }
107:
108:            public String getSKU() {
109:                return this .SKU;
110:            }
111:
112:            public void setSKU(String newSKU) {
113:                this .SKU = newSKU;
114:            }
115:
116:            public double getPrice() {
117:                return this .price;
118:            }
119:
120:            public void setPrice(double newPrice) {
121:                this .price = newPrice;
122:            }
123:
124:            public String getName() {
125:                return this .name;
126:            }
127:
128:            public void setName(String newName) {
129:                this .desc = newName;
130:            }
131:
132:            public String getDescription() {
133:                return this .desc;
134:            }
135:
136:            public void setDescription(String newDesc) {
137:                this .desc = newDesc;
138:            }
139:
140:            /*----------------------------------------------------------------------*/
141:            // Private Methods
142:            /*----------------------------------------------------------------------*/
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.