Source Code Cross Referenced for BinaryConnector.java in  » Test-Coverage » Quilt » org » quilt » graph » 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 » Test Coverage » Quilt » org.quilt.graph 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* BinaryConnector.java */
002:
003:        package org.quilt.graph;
004:
005:        /** 
006:         * A Connector holding two edges. Implementation detail: we assume
007:         * that in laying out bytecode the 'else' code appears immediately
008:         * after the if but the 'then' code is accessed using a goto.
009:         *
010:         * @author <a href="mailto:jddixon@users.sourceforge.net">Jim Dixon</a>
011:         */
012:        public class BinaryConnector extends Connector {
013:            /** The preferred edge, the 'else' edge. */
014:            private Edge edge;
015:            /** The other edge, the 'then' edge. */
016:            private Edge otherEdge;
017:            /** Source of both edges. */
018:            private Vertex source = null;
019:
020:            private void doSetUp(Edge e, Edge otherE) {
021:                if (e == null || otherE == null) {
022:                    throw new IllegalArgumentException(
023:                            "arguments cannot be null");
024:                }
025:                edge = e;
026:                source = edge.getSource();
027:                otherEdge = otherE;
028:                if (source != otherEdge.getSource()) {
029:                    throw new IllegalArgumentException(
030:                            "edges in a BinaryConnector must have the same source");
031:                }
032:            }
033:
034:            public BinaryConnector(Edge e, Edge otherE) {
035:                doSetUp(e, otherE);
036:            }
037:
038:            public BinaryConnector(Connector conn, Edge otherE) {
039:                if (conn == null) {
040:                    throw new IllegalArgumentException(
041:                            "connector cannot be null");
042:                }
043:                doSetUp(conn.getEdge(), otherE);
044:            }
045:
046:            // INTERFACE CONNECTOR //////////////////////////////////////////
047:            /** Get the preferred edge. */
048:            public Edge getEdge() {
049:                return edge;
050:            }
051:
052:            /** Get the target of the preferred edge. */
053:            public Vertex getTarget() {
054:                return edge.getTarget();
055:            }
056:
057:            /** Change the target of the preferred edge. */
058:            public void setTarget(Vertex v) {
059:                checkTarget(v);
060:                edge.setTarget(v);
061:            }
062:
063:            public int size() {
064:                return 2;
065:            }
066:
067:            // OTHER METHODS ////////////////////////////////////////////////
068:            private void checkTarget(final Vertex target) {
069:                if (target == null) {
070:                    throw new IllegalArgumentException("target may not be null");
071:                }
072:                // DEBUG
073:                if (source == null)
074:                    System.out
075:                            .println("BinaryConnector.checkTarget INTERNAL ERROR: "
076:                                    + " source is null");
077:                else if (source.getGraph() == null)
078:                    System.out
079:                            .println("BinaryConnector.checkTarget: source has no graph!");
080:                if (target.getGraph() == null)
081:                    System.out
082:                            .println("BinaryConnector.checkTarget: target has no graph!");
083:                // END
084:                if (target.getGraph() != source.getGraph()) {
085:                    throw new IllegalArgumentException(
086:                            "new target must be in same graph");
087:                }
088:            }
089:
090:            /** Get the other edge. */
091:            public Edge getOtherEdge() {
092:                return otherEdge;
093:            }
094:
095:            /** Get the target of the other edge */
096:            public Vertex getOtherTarget() {
097:                return otherEdge.getTarget();
098:            }
099:
100:            /** Set the target of the other edge. */
101:            public void setOtherTarget(Vertex v) {
102:                checkTarget(v);
103:                otherEdge.setTarget(v);
104:            }
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.