Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do i get the value of the incoming edges and outgoing edge from this class / code ? import java.util. * ; / /

how do i get the value of the incoming edges and outgoing edge from this class/code? import java.util.*;
// A node of a graph for the Spring 2018 ICS 340 program
public class Node {
private String name;
private String value; // The value of the Node which was stored in the value column
private String abbrev; // The abbreviation for the Node
private ArrayList outgoingEdges;
private ArrayList incomingEdges;
public Node(String abbreviation){
abbrev = abbreviation;
value = null;
name = null;
outgoingEdges = new ArrayList();
incomingEdges = new ArrayList();
}
public String getAbbrev(){
return abbrev;
}
public String getName(){
return name;
}
public String getValue(){
return value;
}
public ArrayList getOutgoingEdges(){
return outgoingEdges;
}
public ArrayList getIncomingEdges(){
return incomingEdges;
}
public void setAbbrev(String abbreviation){
abbrev = abbreviation;
}
public void setName(String name){
this.name = name;
}
public void setValue(String value){
this.value = value;
}
public void addOutgoingEdge(Edge e){
outgoingEdges.add(e);
}
public void addIncomingEdge(Edge e){
incomingEdges.add(e);
}
public String toString(){
return "Node "+ name +" has indegree "+ value;
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

Describe the PDCA Cycle.

Answered: 1 week ago