第四单元总结性博客作业
一、架构设计
1、第一次作业
本次作业中, 实现了对类图的分析功能, 主要考察对UML类图的理解和官方包内代码的阅读中, 只需要在一个MyImpletation类中维护多个数据结构的方式来进行存储,
private UmlElement[] elements;
private int classcount = 0;
//父类name->子类name容器
private HashMap<String, ArrayList<String>> fatheridextendsonid = new HashMap<>();
private HashMap<String, String> id2classname = new HashMap<>();
private HashMap<String, String> id2operationname = new HashMap<>();
private HashMap<String, MyNode> id2operationnameid = new HashMap<>();
private HashMap<String, MyNode> id2attributenameid = new HashMap<>();
//统计类名重复
private HashMap<String, ArrayList<String>> classname2id = new HashMap<>();
//统计类name->操作name
private HashMap<String, ArrayList<String>> classname2operationname = new HashMap<>();
//统计操作名重复
private HashMap<String, ArrayList<String>> operationname2id = new HashMap<>();
//统计操作id,name->UmlOperation
private HashMap<MyNode, UmlOperation> name2visibility = new HashMap<>();
//统计类name->操作id,name的容器
private HashMap<String, ArrayList<MyNode>> classname2operationnameid = new HashMap<>();
//统计操作id,name->类name
private HashMap<MyNode, String> operationidname2classname = new HashMap<>();
//统计操作id,name->参数Umlparameter传入的容器
private HashMap<String, ArrayList<UmlParameter>> operationid2UmlParain = new HashMap<>();
//统计操作id,name->参数Umlparameter返回值的容器
private HashMap<String, ArrayList<UmlParameter>> operationid2UmlParareturn = new HashMap<>();
//统计操作id,name->参数type列表
private HashMap<MyNode, HashMap<String, Integer>> operationidname2reftype = new HashMap<>();
//统计属性id,name->UmlAttribute
private HashMap<MyNode, UmlAttribute> attributeidname2uml = new HashMap<>();
//统计类id->ref属性id,name的容器
private HashMap<String, HashMap<String, Integer>> classid2refattributeidname =