Source Code Cross Referenced for CVSTimestamp.java in  » Source-Control » jcvsweb » com » ice » cvsc » 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 » jcvsweb » com.ice.cvsc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         ** Java cvs client library package.
03:         ** Copyright (c) 1997-2002 by Timothy Gerard Endres
04:         ** 
05:         ** This program is free software.
06:         ** 
07:         ** You may redistribute it and/or modify it under the terms of the GNU
08:         ** Library General Public License (LGPL) as published by the Free Software
09:         ** Foundation.
10:         **
11:         ** Version 2 of the license should be included with this distribution in
12:         ** the file LICENSE.txt, as well as License.html. If the license is not
13:         ** included	with this distribution, you may find a copy at the FSF web
14:         ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the Free
15:         ** Software Foundation at 59 Temple Place - Suite 330, Boston, MA 02111 USA.
16:         **
17:         ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
18:         ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
19:         ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
20:         ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
21:         ** REDISTRIBUTION OF THIS SOFTWARE. 
22:         ** 
23:         */
24:
25:        package com.ice.cvsc;
26:
27:        import java.lang.*;
28:        import java.util.*;
29:
30:        /**
31:         * The CVSTimestamp class is a subclass of Date, specifically
32:         * designed to be used as the time stamp of CVS entries. This
33:         * class allows us to display the timestamps of CVS Entries,
34:         * as well as determine when files have been updated.
35:         *
36:         * @version $Revision: 2.6 $
37:         * @author Timothy Gerard Endres, <a href="mailto:time@ice.com">time@ice.com</a>.
38:         * @see CVSTimestampFormat
39:         */
40:
41:        public class CVSTimestamp extends Date implements  Cloneable {
42:            static public final String RCS_ID = "$Id: CVSTimestamp.java,v 2.6 2003/07/27 01:08:32 time Exp $";
43:            static public final String RCS_REV = "$Revision: 2.6 $";
44:
45:            public CVSTimestamp() {
46:                super ();
47:            }
48:
49:            public CVSTimestamp(long msSinceEpoch) {
50:                super (msSinceEpoch);
51:            }
52:
53:            public CVSTimestamp(Date date) {
54:                super (date.getTime());
55:            }
56:
57:            /**
58:             * Determines if this timestamp is considered equivalent to
59:             * the time represented by the parameter we are passed. Note
60:             * that we allow up to, but not including, one second of time
61:             * difference, since Java allows millisecond time resolution
62:             * while CVS stores second resolution timestamps. Further, we
63:             * allow the resolution difference on either side of the second
64:             * because we can not be sure of the rounding.
65:             *
66:             */
67:            public boolean equalsTime(long time) {
68:                return ((this .getTime() > time) ? ((this .getTime() - time) < 1000)
69:                        : ((time - this .getTime()) < 1000));
70:            }
71:
72:            /**
73:             * Determines if this timestamp is considered equivalent to
74:             * the time represented by another timestamp. Note
75:             * that we allow up to, but not including, one second of time
76:             * difference, since Java allows millisecond time resolution
77:             * while CVS stores second resolution timestamps. Further, we
78:             * allow the resolution difference on either side of the second
79:             * because we can not be sure of the rounding.
80:             */
81:            public boolean equalsTimestamp(CVSTimestamp stamp) {
82:                return ((this .getTime() > stamp.getTime()) ? ((this .getTime() - stamp
83:                        .getTime()) < 1000)
84:                        : ((stamp.getTime() - this .getTime()) < 1000));
85:            }
86:
87:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.