View Javadoc
1   package gboat2.base.view.model;
2   
3   import java.util.Comparator;
4   import java.util.List;
5   
6   public class Comp  implements  Cloneable,Comparator<Comp>{
7   	
8   	//名称
9   	private String name;
10  	
11  	//所在目录
12  	private String catalog;
13  	
14  	//主js信息
15  	private List<String> main;
16  	
17  	//版本
18  	private String version;
19  	
20  	//插件
21  	private List<String> plugin;
22  	
23  	//引入时机
24  	private String when;
25  	
26  	//依赖哪些组件
27  	private List<Comp> dependencies;
28  	
29  	//国际化文件名
30  	private String i18nFile = "zh_CN";
31  	
32  	//CSS文件
33  	private List<String> cssFile;
34  	
35  	//引用计数
36  	private int depenNums = 0;
37  	
38  	private String devMode = "false";
39  	
40  	public String getName() {
41  		return name;
42  	}
43  
44  	public void setName(String name) {
45  		this.name = name;
46  	}
47  
48  	public String getVersion() {
49  		return version;
50  	}
51  
52  	public void setVersion(String version) {
53  		this.version = version;
54  	}
55  
56  	public List<String> getPlugin() {
57  		return plugin;
58  	}
59  
60  	public void setPlugin(List<String> plugin) {
61  		this.plugin = plugin;
62  	}
63  
64  	public String getWhen() {
65  		return when;
66  	}
67  
68  	public void setWhen(String when) {
69  		this.when = when;
70  	}
71  
72  	public List<Comp> getDependencies() {
73  		return dependencies;
74  	}
75  
76  	public void setDependencies(List<Comp> dependencies) {
77  		this.dependencies = dependencies;
78  	}
79  
80  	public int getDepenNums() {
81  		return depenNums;
82  	}
83  
84  	public void setDepenNums(int depenNums) {
85  		this.depenNums = depenNums;
86  	}
87  
88  	public String getI18nFile() {
89  		return i18nFile;
90  	}
91  
92  	public void setI18nFile(String i18nFile) {
93  		this.i18nFile = i18nFile;
94  	}
95  
96  	public List<String> getCssFile() {
97  		return cssFile;
98  	}
99  
100 	public void setCssFile(List<String> cssFile) {
101 		this.cssFile = cssFile;
102 	}
103 
104 	public void addDepenNums(){
105 		this.depenNums ++;
106 	}
107 
108 	public String getDevMode() {
109 		return devMode;
110 	}
111 
112 	public void setDevMode(String devMode) {
113 		this.devMode = devMode;
114 	}
115 
116 	public List<String> getMain() {
117 		return main;
118 	}
119 
120 	public void setMain(List<String> main) {
121 		this.main = main;
122 	}
123 	
124 	public Object clone(){ 
125 		Comp o = null; 
126 		try{ 
127 			o = (Comp)super.clone(); 
128 		}catch(CloneNotSupportedException e){ 
129 			e.printStackTrace(); 
130 		} 
131 		return o; 
132 	}
133 
134 
135 	@Override
136 	public int compare(Comp o1, Comp o2) {
137 		if(o1.getDepenNums() >= o2.getDepenNums()){
138 			return 1;
139 		}
140 		return 0;
141 	}
142 
143 	public String getCatalog() {
144 		return catalog;
145 	}
146 
147 	public void setCatalog(String catalog) {
148 		this.catalog = catalog;
149 	} 
150 	
151 	
152 }