Source Code Cross Referenced for PartialOrderNode.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » 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 » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: PartialOrderNode.java,v $
003:         *
004:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * Use is subject to license terms.
007:         *
008:         * $Revision: 1.1 $
009:         * $Date: 2005/02/11 04:57:15 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai;
013:
014:        import java.util.Enumeration;
015:        import java.util.Vector;
016:
017:        /**
018:         * A node in a directed graph of operations.  Each node maintains
019:         * three pieces of information, in addition to an arbitrary
020:         * <code>Object</code> containing user data associated with the node,
021:         * in order to allow topological sorting to be performed in linear time.
022:         *
023:         * <p> First, the in-degree (number of other nodes pointing to this
024:         * node) is stored as an int.  Nodes with in-degree equal to 0 are
025:         * "free" and may appear first in a topological sort.
026:         *
027:         * <p> Second, a reference called <code>zeroLink</code> to another 
028:         * <code>PartialOrderNode</code> is kept in order to allow construction 
029:         * of a linked list of nodes with zero in-degree.
030:         *
031:         * <p> Third, a <code>Vector</code> of neighboring nodes is maintained 
032:         * (in no particular order). These are the nodes which are pointed to
033:         * by the current node.
034:         *
035:         * <p> This class is used by the implementation of the 
036:         * <code>OperationRegistry</code> class and is not intended to be part
037:         * of the API.
038:         *
039:         */
040:        final class PartialOrderNode implements  Cloneable, java.io.Serializable {
041:
042:            /** The name of the object associated with this node. */
043:            protected String name;
044:
045:            /** The data associated with this node. */
046:            protected Object nodeData;
047:
048:            /** The in-degree of the node. */
049:            protected int inDegree = 0;
050:
051:            /** Copy of the inDegree of the node. */
052:            protected int copyInDegree = 0;
053:
054:            /** A link to another node with 0 in-degree, or null. */
055:            protected PartialOrderNode zeroLink = null;
056:
057:            /** A Vector of neighboring nodes. */
058:            Vector neighbors = new Vector();
059:
060:            /**
061:             * Constructs an <code>PartialOrderNode</code> with given associated data.
062:             *
063:             * @param nodeData an <code>Object</code> to associate with this node.
064:             */
065:            PartialOrderNode(Object nodeData, String name) {
066:                this .nodeData = nodeData;
067:                this .name = name;
068:            }
069:
070:            /** Returns the <code>Object</code> represented by this node. */
071:            Object getData() {
072:                return nodeData;
073:            }
074:
075:            /** Returns the name of the <code>Object</code> represented by this node. */
076:            String getName() {
077:                return name;
078:            }
079:
080:            /** Returns the in-degree of this node. */
081:            int getInDegree() {
082:                return inDegree;
083:            }
084:
085:            /** Returns the copy in-degree of this node. */
086:            int getCopyInDegree() {
087:                return copyInDegree;
088:            }
089:
090:            /** Sets the copy in-degree of this node. */
091:            void setCopyInDegree(int copyInDegree) {
092:                this .copyInDegree = copyInDegree;
093:            }
094:
095:            /** Returns the next zero in-degree node in the linked list. */
096:            PartialOrderNode getZeroLink() {
097:                return zeroLink;
098:            }
099:
100:            /** Sets the next zero in-degree node in the linked list. */
101:            void setZeroLink(PartialOrderNode poNode) {
102:                zeroLink = poNode;
103:            }
104:
105:            /** Returns the neighbors of this node as an <code>Enumeration</code>. */
106:            Enumeration getNeighbors() {
107:                return neighbors.elements();
108:            }
109:
110:            /**
111:             * Adds a directed edge to the graph.  The neighbors list of this
112:             * node is updated and the in-degree of the other node is incremented.
113:             */
114:            void addEdge(PartialOrderNode poNode) {
115:                neighbors.addElement(poNode);
116:                poNode.incrementInDegree();
117:            }
118:
119:            /**
120:             * Removes a directed edge from the graph.  The neighbors list of this
121:             * node is updated and the in-degree of the other node is decremented.
122:             */
123:            void removeEdge(PartialOrderNode poNode) {
124:                neighbors.removeElement(poNode);
125:                poNode.decrementInDegree();
126:            }
127:
128:            /** Increments the in-degree of a node. */
129:            void incrementInDegree() {
130:                ++inDegree;
131:            }
132:
133:            /** Increments the copy-in-degree of a node. */
134:            void incrementCopyInDegree() {
135:                ++copyInDegree;
136:            }
137:
138:            /** Decrements the in-degree of a node. */
139:            void decrementInDegree() {
140:                --inDegree;
141:            }
142:
143:            /** Decrements the copy in-degree of a node. */
144:            void decrementCopyInDegree() {
145:                --copyInDegree;
146:            }
147:
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.