Initial commit
This commit is contained in:
27
Experiment/graph/Exp4/AbFather.mermaid
Normal file
27
Experiment/graph/Exp4/AbFather.mermaid
Normal file
@@ -0,0 +1,27 @@
|
||||
classDiagram
|
||||
class Father {
|
||||
<<abstract>>
|
||||
# double height
|
||||
# double weight
|
||||
+ Father(double height, double weight)
|
||||
+ double getHeight()
|
||||
+ void setHeight(double height)
|
||||
+ double getWeight()
|
||||
+ void setWeight(double weight)
|
||||
+ void hobby()
|
||||
}
|
||||
|
||||
class Son {
|
||||
- String personality
|
||||
+ Son(double height, double weight, String personality)
|
||||
+ String getPersonality()
|
||||
+ void setPersonality(String personality)
|
||||
+ void hobby()
|
||||
}
|
||||
|
||||
class Main {
|
||||
+ main(String[] args)
|
||||
}
|
||||
|
||||
Father <|-- Son : 继承
|
||||
Main --> Son : 创建与使用
|
||||
33
Experiment/graph/Exp4/Graphic.mermaid
Normal file
33
Experiment/graph/Exp4/Graphic.mermaid
Normal file
@@ -0,0 +1,33 @@
|
||||
classDiagram
|
||||
class Graphic {
|
||||
<<interface>>
|
||||
+ double area()
|
||||
+ double perimeter()
|
||||
}
|
||||
|
||||
class Circle {
|
||||
- double radius
|
||||
+ Circle(double radius)
|
||||
+ double area()
|
||||
+ double perimeter()
|
||||
+ double getRadius()
|
||||
}
|
||||
|
||||
class Rectangle {
|
||||
- double width
|
||||
- double height
|
||||
+ Rectangle(double width, double height)
|
||||
+ double area()
|
||||
+ double perimeter()
|
||||
+ double getWidth()
|
||||
+ double getHeight()
|
||||
}
|
||||
|
||||
class Test {
|
||||
+ main(String[] args)
|
||||
}
|
||||
|
||||
Graphic <|.. Circle : 实现
|
||||
Graphic <|.. Rectangle : 实现
|
||||
Test --> Circle : 创建与使用
|
||||
Test --> Rectangle : 创建与使用
|
||||
26
Experiment/graph/Exp4/RRect.mermaid
Normal file
26
Experiment/graph/Exp4/RRect.mermaid
Normal file
@@ -0,0 +1,26 @@
|
||||
classDiagram
|
||||
class calrect {
|
||||
<<interface>>
|
||||
+ int calarea()
|
||||
+ int calgirth()
|
||||
+ int getx()
|
||||
+ int gety()
|
||||
}
|
||||
|
||||
class RRect {
|
||||
- int x
|
||||
- int y
|
||||
+ RRect()
|
||||
+ int calarea()
|
||||
+ int calgirth()
|
||||
+ int getx()
|
||||
+ int gety()
|
||||
}
|
||||
|
||||
class Class1 {
|
||||
+ RRect rect
|
||||
+ main(String[] args)
|
||||
}
|
||||
|
||||
calrect <|.. RRect : 实现
|
||||
Class1 --> RRect : 创建与使用
|
||||
Reference in New Issue
Block a user