Source Code Cross Referenced for Book.java in  » Database-ORM » Speedo_1.4.5 » abook » data » 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 ORM » Speedo_1.4.5 » abook.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 16 juin 2005
003:         *
004:
005:         */
006:        package abook.data;
007:
008:        import java.io.Serializable;
009:        import java.util.ArrayList;
010:        import java.util.Collection;
011:
012:        /**
013:         * Provides object of type Book mapping the data stored in the sql database
014:         */
015:        public class Book implements  Serializable {
016:
017:            private long bookId;
018:            private String longTitle;
019:            private String shortTitle;
020:            private double totalDuration; // seconds
021:            private String releaseDate;
022:            private String imageFilePath;
023:            private String urlBook;
024:            private String urlSummary;
025:            private String publisher;
026:            private String bookKind;
027:            private String bookType;
028:            private int popularity;
029:            private Collection authors;
030:            private Collection narrators;
031:            private String mainAuthor;
032:            private String mainNarrator;
033:
034:            /**
035:             * Constructs a new Book object
036:             * @param bookId The book identifier.
037:             * @param title The book title.
038:             */
039:            public Book(String title, long bookId) {
040:                this .longTitle = title;
041:                if (title.length() < 15) {
042:                    this .shortTitle = title;
043:                } else {
044:                    this .shortTitle = (title.substring(0, 12) + "...");
045:                }
046:                this .bookId = bookId;
047:                authors = new ArrayList();
048:                narrators = new ArrayList();
049:            }
050:
051:            /**
052:             * @return Returns the authors.
053:             */
054:            public Collection getAuthors() {
055:                return authors;
056:            }
057:
058:            /**
059:             * @param authors The authors to set.
060:             */
061:            public void setAuthors(Collection authors) {
062:                this .authors = authors;
063:            }
064:
065:            /**
066:             * @return Returns the bookId.
067:             */
068:            public long getBookId() {
069:                return bookId;
070:            }
071:
072:            /**
073:             * @param bookId The bookId to set.
074:             */
075:            public void setBookId(long bookId) {
076:                this .bookId = bookId;
077:            }
078:
079:            /**
080:             * @return Returns the imageFilePath.
081:             */
082:            public String getImageFilePath() {
083:                return imageFilePath;
084:            }
085:
086:            /**
087:             * @param imageFilePath The imageFilePath to set.
088:             */
089:            public void setImageFilePath(String imageFilePath) {
090:                this .imageFilePath = imageFilePath;
091:            }
092:
093:            /**
094:             * @return Returns the longTitle.
095:             */
096:            public String getLongTitle() {
097:                return longTitle;
098:            }
099:
100:            /**
101:             * @param longTitle The longTitle to set.
102:             */
103:            public void setLongTitle(String longTitle) {
104:                this .longTitle = longTitle;
105:            }
106:
107:            /**
108:             * @return Returns the narrators.
109:             */
110:            public Collection getNarrators() {
111:                return narrators;
112:            }
113:
114:            /**
115:             * @param narrators The narrators to set.
116:             */
117:            public void setNarrators(Collection narrators) {
118:                this .narrators = narrators;
119:            }
120:
121:            /**
122:             * @return Returns the releaseDate.
123:             */
124:            public String getReleaseDate() {
125:                return releaseDate;
126:            }
127:
128:            /**
129:             * @param releaseDate The releaseDate to set.
130:             */
131:            public void setReleaseDate(String releaseDate) {
132:                this .releaseDate = releaseDate;
133:            }
134:
135:            /**
136:             * @return Returns the shortTitle.
137:             */
138:            public String getShortTitle() {
139:                return shortTitle;
140:            }
141:
142:            /**
143:             * @param shortTitle The shortTitle to set.
144:             */
145:            public void setShortTitle(String shortTitle) {
146:                this .shortTitle = shortTitle;
147:            }
148:
149:            /**
150:             * @return Returns the totalDuration.
151:             */
152:            public double getTotalDuration() {
153:                return totalDuration;
154:            }
155:
156:            /**
157:             * @param totalDuration The totalDuration to set.
158:             */
159:            public void setTotalDuration(double totalDuration) {
160:                this .totalDuration = totalDuration;
161:            }
162:
163:            /**
164:             * @return Returns the bookType.
165:             */
166:            public String getBookType() {
167:                return bookType;
168:            }
169:
170:            /**
171:             * @param bookType The bookType to set.
172:             */
173:            public void setBookType(String bookType) {
174:                this .bookType = bookType;
175:            }
176:
177:            /**
178:             * @return Returns the urlBook.
179:             */
180:            public String getUrlBook() {
181:                return urlBook;
182:            }
183:
184:            /**
185:             * @param urlBook The urlBook to set.
186:             */
187:            public void setUrlBook(String urlBook) {
188:                this .urlBook = urlBook;
189:            }
190:
191:            /**
192:             * @return Returns the urlSummary.
193:             */
194:            public String getUrlSummary() {
195:                return urlSummary;
196:            }
197:
198:            /**
199:             * @param urlSummary The urlSummary to set.
200:             */
201:            public void setUrlSummary(String urlSummary) {
202:                this .urlSummary = urlSummary;
203:            }
204:
205:            /**
206:             * @return Returns the bookKind.
207:             */
208:            public String getBookKind() {
209:                return bookKind;
210:            }
211:
212:            /**
213:             * @param bookKind The bookKind to set.
214:             */
215:            public void setBookKind(String bookKind) {
216:                this .bookKind = bookKind;
217:            }
218:
219:            /**
220:             * @return Returns the popularity.
221:             */
222:            public int getPopularity() {
223:                return popularity;
224:            }
225:
226:            /**
227:             * @param popularity The popularity to set.
228:             */
229:            public void setPopularity(int popularity) {
230:                this .popularity = popularity;
231:            }
232:
233:            /**
234:             * @return Returns the publisher.
235:             */
236:            public String getPublisher() {
237:                return publisher;
238:            }
239:
240:            /**
241:             * @param publisher The publisher to set.
242:             */
243:            public void setPublisher(String publisher) {
244:                this .publisher = publisher;
245:            }
246:
247:            /**
248:             * @return Returns the mainAuthor.
249:             */
250:            String getMainAuthor() {
251:                return mainAuthor;
252:            }
253:
254:            /**
255:             * @param mainAuthor The mainAuthor to set.
256:             */
257:            void setMainAuthor(String mainAuthor) {
258:                this .mainAuthor = mainAuthor;
259:            }
260:
261:            /**
262:             * @return Returns the mainNarrator.
263:             */
264:            String getMainNarrator() {
265:                return mainNarrator;
266:            }
267:
268:            /**
269:             * @param mainNarrator The mainNarrator to set.
270:             */
271:            void setMainNarrator(String mainNarrator) {
272:                this .mainNarrator = mainNarrator;
273:            }
274:
275:            /**
276:             * @param author an author to add to the authors collection of the book
277:             * @return true if this collection changed as a result of the call
278:             */
279:            public boolean add(Object author) {
280:                return authors.add(author);
281:            }
282:
283:            /**
284:             * @param arg0 a collection of authors
285:             * @return if this collection changed as a result of the call
286:             */
287:            public boolean addAll(Collection arg0) {
288:                return authors.addAll(arg0);
289:            }
290:
291:            /**
292:             * @param author The author to add.
293:             */
294:            public void addAuthor(Author author) {
295:                authors.add(author);
296:                author.addBook(this );
297:            }
298:
299:            /**
300:             * @param narrator The narrator to add.
301:             */
302:            public void addNarrator(Narrator narrator) {
303:                narrators.add(narrator);
304:                narrator.addBook(this );
305:            }
306:
307:            /**
308:             * @return Returns the totalDuration in a String format.
309:             */
310:            public String getStrTotalDuration() {
311:                if (totalDuration == 0) {
312:                    return "";
313:                }
314:                long h = (long) totalDuration / 3600;
315:                long m = ((long) totalDuration - (h * 3600)) / 60;
316:                long s = ((long) totalDuration - (m * 60));
317:                String result = String.valueOf(h) + ":" + String.valueOf(m)
318:                        + ":" + String.valueOf(s);
319:                return result;
320:            }
321:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.