Skip to content

Commit b53effc

Browse files
committed
added javaDocs for Graph Class and My exception Class
1 parent 38b0242 commit b53effc

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package Exceptions;
2+
3+
public class MyException extends Exception{
4+
5+
private String myException;
6+
7+
/**
8+
* Constructor for a new exception
9+
* @param myException exception text
10+
*/
11+
public MyException(String myException){
12+
this.myException = myException;
13+
}
14+
15+
@Override
16+
public String toString() {
17+
return "Custom Exception: "+ myException;
18+
}
19+
}

_4/src/main/java/Graph.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,85 @@ public class Graph {
55
private String imagePath;
66
private String tgfPath;
77

8+
/**
9+
* Default constructor
10+
*/
811
public Graph(){
912

1013
}
1114

15+
/**
16+
* Constructor for a new graph
17+
* @param name graph name
18+
* @param imagePath graph image path
19+
* @param tgfPath graph tgf path ( details )
20+
*/
1221
public Graph(String name, String imagePath, String tgfPath) {
1322
this.name = name;
1423
this.imagePath = imagePath;
1524
this.tgfPath = tgfPath;
1625
}
1726

27+
/**
28+
* Getter for description
29+
* @return graph description
30+
*/
1831
public String getDescription() {
1932
return description;
2033
}
2134

35+
/**
36+
* Set the graph description
37+
* @param description graph description
38+
*/
2239
public void setDescription(String description) {
2340
this.description = description;
2441
}
2542

43+
/**
44+
* Get graph name
45+
* @return graph name
46+
*/
2647
public String getName() {
2748
return name;
2849
}
2950

51+
/**
52+
* Set graph name
53+
* @param name graph name
54+
*/
3055
public void setName(String name) {
3156
this.name = name;
3257
}
3358

59+
/**
60+
* Get graph image path
61+
* @return image path
62+
*/
3463
public String getImagePath() {
3564
return imagePath;
3665
}
3766

67+
/**
68+
* Set graph image path
69+
* @param imagePath image path
70+
*/
3871
public void setImagePath(String imagePath) {
3972
this.imagePath = imagePath;
4073
}
4174

75+
/**
76+
* Get the tgf (details) of the graph
77+
* @return the path to the tgf for the graph
78+
*/
4279
public String getTgfPath() {
4380
return tgfPath;
4481
}
4582

83+
/**
84+
* Set the path for the tgf (details) of the graph
85+
* @param tgfPath the path for the tgf of the graph
86+
*/
4687
public void setTgfPath(String tgfPath) {
4788
this.tgfPath = tgfPath;
4889
}

0 commit comments

Comments
 (0)