Source Code Cross Referenced for Message.java in  » Rule-Engine » zilonis » org » zilonis » tool » ext » mailman » model » 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 » Rule Engine » zilonis » org.zilonis.tool.ext.mailman.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (c) 2006, Sun Microsystems, Inc
003:         * All rights reserved.
004:         * 
005:         * Redistribution and use in source and binary forms, with or without
006:         * modification, are permitted provided that the following conditions
007:         * are met:
008:         * 
009:         *   * Redistributions of source code must retain the above copyright
010:         *     notice, this list of conditions and the following disclaimer.
011:         *   * Redistributions in binary form must reproduce the above
012:         *     copyright notice, this list of conditions and the following 
013:         *     disclaimer in the documentation and/or other materials provided 
014:         *     with the distribution.
015:         *   * Neither the name of the TimingFramework project nor the names of its
016:         *     contributors may be used to endorse or promote products derived 
017:         *     from this software without specific prior written permission.
018:         * 
019:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
020:         * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
021:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
022:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
023:         * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
024:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
025:         * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
026:         * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
027:         * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
028:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
029:         * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030:         */package org.zilonis.tool.ext.mailman.model;
031:
032:        import java.io.IOException;
033:        import java.lang.ref.SoftReference;
034:        import java.util.Date;
035:        import java.util.Arrays;
036:        import java.util.Map;
037:        import java.util.HashMap;
038:
039:        public class Message {
040:            private int position;
041:            private String id;
042:            private Contact from;
043:            private Contact[] to;
044:            private Contact[] cc;
045:            private String subject;
046:            private long date;
047:            private String[] refs;
048:            private SoftReference<String> bodyRef;
049:            private boolean read;
050:
051:            public Message(int position) {
052:                this .position = position;
053:            }
054:
055:            public void setRead(boolean read) {
056:                this .read = read;
057:            }
058:
059:            public boolean isRead() {
060:                return read;
061:            }
062:
063:            int getPosition() {
064:                return position;
065:            }
066:
067:            public String toString() {
068:                return "Message [" + "id=" + id + "read=" + read + " subject="
069:                        + subject + " from=" + from + " to="
070:                        + ((to == null) ? "" : Arrays.asList(to)) + " cc="
071:                        + ((cc == null) ? "" : Arrays.asList(cc)) + " refs="
072:                        + ((refs == null) ? "" : Arrays.asList(refs))
073:                        + " date=" + new Date(date) + "]";
074:            }
075:
076:            //    public Message(Contact from, Contact[] to, Contact[] cc, String subject,
077:            //                   String body, Attachment[] attachment,
078:            //                   Map<String, String> headers, Date dateTime) {
079:            //        if (from == null) {
080:            //            throw new IllegalArgumentException("Sender cannot be null.");
081:            //        } else if (to == null || to.length == 0) {
082:            //            throw new IllegalArgumentException("One recipient is required.");
083:            //        }
084:            //        this.from = from;
085:            //        this.to = to;
086:            //        this.cc = cc;
087:            //        this.subject = subject == null ? "" : subject;
088:            //        this.body = body == null ? "" : body;
089:            //        this.attachment = attachment;
090:            //        this.headers = headers == null ? new HashMap<String, String>() : headers;
091:            //        if (dateTime == null) {
092:            //            dateTime = new Date();
093:            //        }
094:            //        this.dateTime = (Date) dateTime.clone();
095:            //    }
096:
097:            public long getDateTime() {
098:                return date;
099:            }
100:
101:            public Map<String, String> getHeaders() {
102:                // PENDING:
103:                throw new RuntimeException("implement me");
104:                //        return null;
105:            }
106:
107:            /**
108:             * Returns a clone of the contact
109:             */
110:            public Contact getFrom() {
111:                return from;
112:            }
113:
114:            /**
115:             * Returns a clone of the contacts
116:             */
117:            public Contact[] getTo() {
118:                if (to == null) {
119:                    return to;
120:                }
121:                return to.clone();
122:            }
123:
124:            /**
125:             * Returns a clone of the contacts
126:             */
127:            public Contact[] getCc() {
128:                if (cc == null) {
129:                    return null;
130:                }
131:                return cc.clone();
132:            }
133:
134:            public String getSubject() {
135:                return subject;
136:            }
137:
138:            //    @Override
139:            //    public boolean equals(Object o) {
140:            //        if (this == o) {
141:            //            return true;
142:            //        }
143:            //        if (o == null || getClass() != o.getClass()) {
144:            //            return false;
145:            //        }
146:            //        final Message message = (Message) o;
147:            //        if (!Arrays.equals(attachment, message.attachment)) {
148:            //            return false;
149:            //        }
150:            //        if (body != null ? !body.equals(message.body) : message.body != null) {
151:            //            return false;
152:            //        }
153:            //        if (!Arrays.equals(cc, message.cc)) {
154:            //            return false;
155:            //        }
156:            //        if (dateTime != null ? !dateTime.equals(message.dateTime) :
157:            //            message.dateTime != null) {
158:            //            return false;
159:            //        }
160:            //        if (from != null ? !from.equals(message.from) : message.from != null) {
161:            //            return false;
162:            //        }
163:            //        if (subject != null ? !subject.equals(message.subject) :
164:            //            message.subject != null) {
165:            //            return false;
166:            //        }
167:            //        return Arrays.equals(to, message.to);
168:            //    }
169:            //
170:            //    @Override
171:            //    public int hashCode() {
172:            //        int result;
173:            //        result = (from != null ? from.hashCode() : 0);
174:            //        result = 29 * result + (subject != null ? subject.hashCode() : 0);
175:            //        result = 29 * result + (body != null ? body.hashCode() : 0);
176:            //        result = 29 * result + (dateTime != null ? dateTime.hashCode() : 0);
177:            //        return result;
178:            //    }
179:
180:            public void setCc(Contact[] contact) {
181:                this .cc = contact;
182:            }
183:
184:            public void setDate(long date) {
185:                this .date = date;
186:            }
187:
188:            public void setFrom(Contact from) {
189:                this .from = from;
190:            }
191:
192:            public void setID(String id) {
193:                this .id = id;
194:            }
195:
196:            public void setReferences(String[] refs) {
197:                this .refs = refs;
198:            }
199:
200:            public void setSubject(String subject) {
201:                this .subject = subject;
202:            }
203:
204:            public void setTo(Contact[] to) {
205:                this.to = to;
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.