Source Code Cross Referenced for SVNNodeKind.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:        /**
016:         * The <b>SVNNodeKind</b> class is used to describe the kind of a 
017:         * directory entry (node, in other words). This can be:
018:         * <ul>
019:         * <li>a directory - the node is a directory
020:         * <li>a file      - the node is a file
021:         * <li>none        - the node is missing (does not exist)
022:         * <li>unknown     - the node kind can not be recognized
023:         * </ul>
024:         *  
025:         * @version 1.1.1
026:         * @author  TMate Software Ltd.
027:         * @see 	SVNDirEntry
028:         */
029:        public final class SVNNodeKind implements  Comparable {
030:            /**
031:             * This node kind is used to say that a node is missing  
032:             */
033:            public static final SVNNodeKind NONE = new SVNNodeKind(2);
034:            /**
035:             * Defines the file node kind
036:             */
037:            public static final SVNNodeKind FILE = new SVNNodeKind(1);
038:            /**
039:             * Defines the directory node kind
040:             */
041:            public static final SVNNodeKind DIR = new SVNNodeKind(0);
042:            /**
043:             * This node kind is used to say that the kind of a node is
044:             * actually unknown
045:             */
046:            public static final SVNNodeKind UNKNOWN = new SVNNodeKind(3);
047:
048:            private int myID;
049:
050:            private SVNNodeKind(int id) {
051:                myID = id;
052:            }
053:
054:            /**
055:             * Parses the passed string and finds out the node kind. For instance,
056:             * <code>parseKind(<span class="javastring">"dir"</span>)</code> will return 
057:             * {@link #DIR}.
058:             * 
059:             * @param kind 		a node kind as a string
060:             * @return 			an <b>SVNNodeKind</b> representation
061:             */
062:            public static SVNNodeKind parseKind(String kind) {
063:                if ("file".equals(kind)) {
064:                    return FILE;
065:                } else if ("dir".equals(kind)) {
066:                    return DIR;
067:                } else if ("none".equals(kind) || kind == null) {
068:                    return NONE;
069:                }
070:                return UNKNOWN;
071:            }
072:
073:            /**
074:             * Represents the current <b>SVNNodeKind</b> object as a string.
075:             * 
076:             * @return a string representation of this object.
077:             */
078:            public String toString() {
079:                if (this  == NONE) {
080:                    return "none";
081:                } else if (this  == FILE) {
082:                    return "file";
083:                } else if (this  == DIR) {
084:                    return "dir";
085:                }
086:                return "unknown";
087:            }
088:
089:            /**
090:             * Compares this object with another one.
091:             * Each <b>SVNNodeKind</b> constant has got its own unique id.
092:             * 
093:             * @param   o an object to compare with
094:             * @return    <ul>
095:             *            <li>-1 - if <code>o</code> is either <span class="javakeyword">null</span>,
096:             *            or is not an instance of <b>SVNNodeKind</b>, or the id of
097:             *            this object is smaller than the id of <code>o</code>;
098:             *            </li>
099:             *            <li>1 - if the id of this object is bigger than the id of 
100:             *            <code>o</code>;
101:             *            </li>
102:             *            <li>0 - if and only if <code>o</code> is the same constant 
103:             *            value as this one (has the same id)
104:             *            </li>
105:             *            </ul>
106:             */
107:            public int compareTo(Object o) {
108:                if (o == null || o.getClass() != SVNNodeKind.class) {
109:                    return -1;
110:                }
111:                int otherID = ((SVNNodeKind) o).myID;
112:                return myID > otherID ? 1 : myID < otherID ? -1 : 0;
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.