Source Code Cross Referenced for SVNLogEntry.java in  » Source-Control » tmatesoft-SVN » org » tmatesoft » svn » core » 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 » Source Control » tmatesoft SVN » org.tmatesoft.svn.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ====================================================================
003:         * Copyright (c) 2004-2008 TMate Software Ltd.  All rights reserved.
004:         *
005:         * This software is licensed as described in the file COPYING, which
006:         * you should have received as part of this distribution.  The terms
007:         * are also available at http://svnkit.com/license.html
008:         * If newer versions of this license are posted there, you may use a
009:         * newer version instead, at your option.
010:         * ====================================================================
011:         */
012:
013:        package org.tmatesoft.svn.core;
014:
015:        import java.io.Serializable;
016:        import java.util.Date;
017:        import java.util.Iterator;
018:        import java.util.Map;
019:
020:        /**
021:         * The <b>SVNLogEntry</b> class encapsulates such per revision information as: 
022:         * a revision number, the datestamp when the revision was committed, the author 
023:         * of the revision, a commit log message and all paths changed in that revision. 
024:         * 
025:         * @version 1.1.1
026:         * @author  TMate Software Ltd.
027:         * @see 	SVNLogEntryPath
028:         * @see     ISVNLogEntryHandler
029:         * @see     <a target="_top" href="http://svnkit.com/kb/examples/">Examples</a>
030:         */
031:        public class SVNLogEntry implements  Serializable {
032:
033:            private long myRevision;
034:            private String myAuthor;
035:            private Date myDate;
036:            private String myMessage;
037:            private Map myChangedPaths;
038:
039:            /**
040:             * Constructs an <b>SVNLogEntry</b> object. 
041:             * 
042:             * @param changedPaths 	a map collection which keys are
043:             * 						all the paths that were changed in   
044:             *                      <code>revision</code>, and values are 
045:             * 						<b>SVNLogEntryPath</b> representation objects
046:             * @param revision 		a revision number
047:             * @param author 		the author of <code>revision</code>
048:             * @param date 			the datestamp when the revision was committed
049:             * @param message 		an commit log message for <code>revision</code>
050:             * @see 				SVNLogEntryPath
051:             */
052:            public SVNLogEntry(Map changedPaths, long revision, String author,
053:                    Date date, String message) {
054:                myRevision = revision;
055:                myAuthor = author;
056:                myDate = date;
057:                myMessage = message;
058:                myChangedPaths = changedPaths;
059:            }
060:
061:            /**
062:             * Gets a map containing all the paths that were changed in the 
063:             * revision that this object represents.
064:             * 
065:             * @return 		a map which keys are all the paths 
066:             * 				that were changed and values are 
067:             * 				<b>SVNLogEntryPath</b> objects
068:             * 
069:             */
070:            public Map getChangedPaths() {
071:                return myChangedPaths;
072:            }
073:
074:            /**
075:             * Returns the author of the revision that this object represents.
076:             * 
077:             * @return the author of the revision
078:             */
079:            public String getAuthor() {
080:                return myAuthor;
081:            }
082:
083:            /**
084:             * Gets the datestamp when the revision was committed.
085:             * 
086:             * @return 	the moment in time when the revision was committed
087:             */
088:            public Date getDate() {
089:                return myDate;
090:            }
091:
092:            /**
093:             * Gets the log message attached to the revision.
094:             * 
095:             * @return 		the commit log message
096:             */
097:            public String getMessage() {
098:                return myMessage;
099:            }
100:
101:            /**
102:             * Gets the number of the revision that this object represents.
103:             * 
104:             * @return 	a revision number 
105:             */
106:            public long getRevision() {
107:                return myRevision;
108:            }
109:
110:            /**
111:             * Calculates and returns a hash code for this object.
112:             * 
113:             * @return a hash code
114:             */
115:            public int hashCode() {
116:                final int PRIME = 31;
117:                int result = 1;
118:                result = PRIME * result
119:                        + (int) (myRevision ^ (myRevision >>> 32));
120:                result = PRIME * result
121:                        + ((myAuthor == null) ? 0 : myAuthor.hashCode());
122:                result = PRIME * result
123:                        + ((myDate == null) ? 0 : myDate.hashCode());
124:                result = PRIME * result
125:                        + ((myMessage == null) ? 0 : myMessage.hashCode());
126:                result = PRIME
127:                        * result
128:                        + ((myChangedPaths == null) ? 0 : myChangedPaths
129:                                .hashCode());
130:                return result;
131:            }
132:
133:            /**
134:             * Compares this object with another one.
135:             * 
136:             * @param  obj  an object to compare with
137:             * @return      <span class="javakeyword">true</span> 
138:             *              if this object is the same as the <code>obj</code> 
139:             *              argument
140:             */
141:            public boolean equals(Object obj) {
142:                if (this  == obj) {
143:                    return true;
144:                }
145:                if (obj == null || getClass() != obj.getClass()) {
146:                    return false;
147:                }
148:                SVNLogEntry other = (SVNLogEntry) obj;
149:                return myRevision == other.myRevision
150:                        && compare(myAuthor, other.myAuthor)
151:                        && compare(myMessage, other.myMessage)
152:                        && compare(myDate, other.myDate)
153:                        && compare(myChangedPaths, other.myChangedPaths);
154:            }
155:
156:            /**
157:             * Gives a string representation of this oobject.
158:             * 
159:             * @return a string representing this object
160:             */
161:            public String toString() {
162:                StringBuffer result = new StringBuffer();
163:                result.append(myRevision);
164:                if (myDate != null) {
165:                    result.append(' ');
166:                    result.append(myDate);
167:                }
168:                if (myAuthor != null) {
169:                    result.append(' ');
170:                    result.append(myAuthor);
171:                }
172:                if (myMessage != null) {
173:                    result.append('\n');
174:                    result.append(myMessage);
175:                }
176:                if (myChangedPaths != null && !myChangedPaths.isEmpty()) {
177:                    for (Iterator paths = myChangedPaths.values().iterator(); paths
178:                            .hasNext();) {
179:                        result.append('\n');
180:                        SVNLogEntryPath path = (SVNLogEntryPath) paths.next();
181:                        result.append(path.toString());
182:                    }
183:                }
184:                return result.toString();
185:            }
186:
187:            /**
188:             * Compares two objects.
189:             * 
190:             * @param o1 the first object to compare
191:             * @param o2 the second object to compare
192:             * @return   <span class="javakeyword">true</span> if either both
193:             *           <code>o1</code> and <code>o2</code> are <span class="javakeyword">null</span> 
194:             *           or <code>o1.equals(o2)</code> returns <span class="javakeyword">true</span>  
195:             */
196:            static boolean compare(Object o1, Object o2) {
197:                if (o1 == null) {
198:                    return o2 == null;
199:                }
200:                return o1.equals(o2);
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.