Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: luna/LunaEdge.java


1   package luna;
2   
3   import giny.model.*;
4   import giny.util.*;
5   
6   public class LunaEdge implements Edge {
7   
8      /**
9      * The Index of this Node in its RootGraph
10     */
11    protected int rootGraphIndex;
12    
13    /**
14     * The RootGraph the we belong to
15     */
16    protected RootGraph rootGraph;
17  
18    /**
19     * The Identifier for this Edge
20     */
21    protected String identifier;
22  
23    public LunaEdge ( int root_graph_index, RootGraph root_graph ) {
24      this.rootGraphIndex = root_graph_index;
25      this.rootGraph = root_graph;    
26    }
27  
28    public RootGraph getRootGraph () {
29      return rootGraph;
30    }
31             
32    public int getRootGraphIndex () {
33      return rootGraphIndex;
34    }
35  
36    public boolean isDirected () {
37      return rootGraph.isEdgeDirected( rootGraphIndex );
38    }
39  
40    public Node getSource () {
41      return rootGraph.getNode( rootGraph.getEdgeSourceIndex( rootGraphIndex ) );
42    }
43             
44    public Node getTarget () {
45      return rootGraph.getNode( rootGraph.getEdgeTargetIndex( rootGraphIndex ) );
46    }
47    
48    public String getIdentifier () {
49      if ( identifier == null ) {
50        return ( new Integer( rootGraphIndex )).toString();
51      } 
52      return identifier;
53    }
54  
55    public boolean setIdentifier ( String new_id ) {
56      identifier = new_id;
57      return true;
58    }
59    
60   
61  
62  }