source code formatting.
[utils] / system / general / src / main / java / org / wamblee / system / graph / DefaultEdge.java
1 /*
2  * Copyright 2008 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.wamblee.system.graph;
17
18 /**
19  * Represents an application-independent edge of a graph.  Applications
20  * might choose to implement the Edge interface directly.
21  *
22  * @author Erik Brakkee
23  */
24 public class DefaultEdge implements Edge {
25     /**
26      * DOCUMENT ME!
27      */
28     private Node from;
29
30     /**
31      * DOCUMENT ME!
32      */
33     private Node to;
34
35     /**
36      * Creates a new DefaultEdge object.
37      *
38      * @param aFrom DOCUMENT ME!
39      * @param aTo DOCUMENT ME!
40      */
41     public DefaultEdge(Node aFrom, Node aTo) {
42         from     = aFrom;
43         to       = aTo;
44     }
45
46     /**
47      * DOCUMENT ME!
48      *
49      * @return DOCUMENT ME!
50      */
51     @Override
52     public Node getFrom() {
53         return from;
54     }
55
56     /**
57      * DOCUMENT ME!
58      *
59      * @return DOCUMENT ME!
60      */
61     @Override
62     public Node getTo() {
63         return to;
64     }
65
66     /**
67      * DOCUMENT ME!
68      *
69      * @return DOCUMENT ME!
70      */
71     @Override
72     public String toString() {
73         return "Edge(" + from.getName() + ", " + to.getName() + ")";
74     }
75 }