|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--shared.GraphObject
|
+--shared.Node
Node representation object for internal use in the Graph class.
Graph| Field Summary | |
int[] |
adj_length
The lengths of all Edges that have this Node as their source Node. |
Edge[] |
first_adj_edge
The Edge chain that represents the first edge connecting to this Node. |
int |
index_number
The index number of this Node object. |
Edge[] |
last_adj_edge
The Edge chain that represents the last edge connecting to this Node. |
Graph |
owner
The Graph class that owns this Node object. |
| Fields inherited from class shared.GraphObject |
data,
id,
obj_list_pred,
obj_list_succ |
| Constructor Summary | |
Node(java.lang.Object inf)
Constructor. |
|
| Method Summary | |
java.util.LinkedList |
adj_edges()
Return a list of all Edges starting from this Node. |
java.util.LinkedList |
adj_nodes()
Returns a list of the Node targets of all Edges whose source is this Node. |
void |
append_adj_edge(Edge e,
int i,
int chain_e)
Appends the given Edge to the adjacency list of this Node. |
void |
copy(Node original)
Copies the given Node object into this Node object. |
int |
degree()
Returns the number of Edges connected to this Node. |
void |
del_adj_edge(Edge e,
int i,
int chain_e)
Deletes the specified Edge. |
Edge |
first_adj_edge()
Returns the first Edge in the adjacency list of this Node. |
Edge |
First_Adj_Edge(int i)
Returns the first adjacent Edge at the indicated position in the adjacency list. |
Edge |
first_in_edge()
Returns the first Edge with this Node as its target. |
java.lang.Object |
getData()
Returns the data stored in this Node object. |
Graph |
graph_of()
Returns the Graph that contains this Node. |
java.util.LinkedList |
in_edges()
Returns a list of all Edges ending at this Node. |
int |
indeg()
Returns the number of Edges leading into this Node. |
int |
index()
Returns the index number of this Node object. |
void |
insert_adj_edge(Edge e,
Edge e1,
int i,
int chain_e,
int dir)
Inserts an Edge object into the chain of Edges. |
Edge |
last_adj_edge()
Returns the last Edge in the adjacency list of this Node. |
Edge |
Last_Adj_Edge(int i)
Returns the last adjacent Edge at the indicated position in the adjacency list. |
Edge |
last_in_edge()
Returns the last Edge with this Node as its target. |
java.util.LinkedList |
out_edges()
Return a list of all Edges starting from this Node if the owning Graph is directed, otherwise an empty list is returned. |
int |
outdeg()
Returns the number of Edges adjacent to Node. |
void |
print_node(java.io.Writer out)
Displays this Node object. |
void |
setIndexNumber(int new_number)
Sets the index number for this Node object. |
java.lang.String |
toString()
Converts this Node object to a String representation. |
| Methods inherited from class shared.GraphObject |
set_id |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public Graph owner
public Edge[] first_adj_edge
public Edge[] last_adj_edge
public int[] adj_length
public int index_number
| Constructor Detail |
public Node(java.lang.Object inf)
inf - The data to be stored in this Node object.| Method Detail |
public void append_adj_edge(Edge e,
int i,
int chain_e)
e - The Edge to be added.i - Position in the adjancency list.chain_e - The position in the chain of Edges making up this edge representation.
public void insert_adj_edge(Edge e,
Edge e1,
int i,
int chain_e,
int dir)
e - The Edge to be inserted.e1 - The Edge in the chain of Edge objects that will be connected to the Edge being
inserted.i - The position in the adjacency list indicating the chain of Edges to be added to.chain_e - The position in the chain of Edges making up this edge representation.dir - If dir is 0, the Edge e is inserted after e1 in the chain of Edges, otherwise e
is inserted before e1.
public void del_adj_edge(Edge e,
int i,
int chain_e)
e - The Edge to be deleted.i - The Edge chain containing the Edge to be deleted.chain_e - The position in the chain of Edges making up this edge representation.public java.lang.Object getData()
public Graph graph_of()
public int index()
public int outdeg()
public int indeg()
public int degree()
public void copy(Node original)
original - The Node object to be copied.public Edge First_Adj_Edge(int i)
i - The position of this Edge.public Edge Last_Adj_Edge(int i)
i - The position of this Edge.public java.util.LinkedList adj_edges()
public java.util.LinkedList out_edges()
public java.util.LinkedList in_edges()
public java.util.LinkedList adj_nodes()
public Edge first_adj_edge()
public Edge last_adj_edge()
public Edge first_in_edge()
public Edge last_in_edge()
public void print_node(java.io.Writer out)
throws java.io.IOException
out - The Writer to which this Node object will be displayed.public java.lang.String toString()
public void setIndexNumber(int new_number)
new_number - The new index number.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||