1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 package transex3.model;
23 
24 public class SdfEntity {
25 	private String project;
26 	private String source_file;
27 	private String dummy1;
28 	private String resource_type;
29 	private String gid;
30 	private String lid;
31 	private String helpid;
32 	private String platform;
33 	private String dummy2;
34 	private String langid;
35 	private String text;
36 	private String helptext;
37 	private String quickhelptext;
38 	private String title;
39 	private String date;
40 
41 	public static int PROJECT_POS 		= 0;
42 	public static int SOURCE_FILE_POS	= 1;
43 	public static int DUMMY1_POS		= 2;
44 	public static int RESOURCE_TYPE_POS	= 3;
45 	public static int GID_POS			= 4;
46 	public static int LID_POS			= 5;
47 	public static int HELPID_POS		= 6;
48 	public static int PLATFORM_POS		= 7;
49 	public static int DUMMY2_POS		= 8;
50 	public static int LANGID_POS		= 9;
51 	public static int TEXT_POS			= 10;
52 	public static int HELPTEXT_POS		= 11;
53 	public static int QUICKHELPTEXT_POS	= 12;
54 	public static int TITLE_POS			= 13;
55 	public static int DATE_POS			= 14;
56 
SdfEntity()57 	public SdfEntity(){}
SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date)58 	public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) {
59 		super();
60 		this.project 		= project;
61 		this.source_file 	= source_file;
62 		this.dummy1 		= dummy1;
63 		this.resource_type 	= resource_type;
64 		this.gid 			= gid;
65 		this.lid 			= lid;
66 		this.helpid 		= helpid;
67 		this.platform 		= platform;
68 		this.dummy2 		= dummy2;
69 		this.langid 		= langid;
70 		this.text 			= text;
71 		this.helptext 		= helptext;
72 		this.quickhelptext 	= quickhelptext;
73 		this.title 			= title;
74 		this.date 			= date;
75 	}
76 
setProperties( String line )77 	public void setProperties( String line ){
78 
79 		String[] splitted		= line.split("\t");
80 
81 		setProject( 		splitted[ SdfEntity.PROJECT_POS ] 		);
82 		setSource_file( 	splitted[ SdfEntity.SOURCE_FILE_POS ] 	);
83 		setDummy1( 			splitted[ SdfEntity.DUMMY1_POS ] 		);
84 		setResource_type(	splitted[ SdfEntity.RESOURCE_TYPE_POS ] );
85 		setGid( 			splitted[ SdfEntity.GID_POS ] 			);
86 		setLid( 			splitted[ SdfEntity.LID_POS ] 			);
87 		setHelpid( 			splitted[ SdfEntity.HELPID_POS ] 		);
88 		setPlatform( 		splitted[ SdfEntity.PLATFORM_POS ] 		);
89 		setDummy2( 			splitted[ SdfEntity.DUMMY2_POS ] 		);
90 		setLangid( 			splitted[ SdfEntity.LANGID_POS ] 		);
91 		setText( 			splitted[ SdfEntity.TEXT_POS ] 			);
92 		setHelptext( 		splitted[ SdfEntity.HELPTEXT_POS ] 		);
93 		setQuickhelptext(	splitted[ SdfEntity.QUICKHELPTEXT_POS ] );
94 		setTitle( 			splitted[ SdfEntity.TITLE_POS ] 		);
95 		setDate(			splitted[ SdfEntity.DATE_POS ]			);
96 	}
97 
getFileId()98 	public String getFileId(){
99 		return project+"\\"+source_file;
100 	}
getResourcePath()101 	public String getResourcePath(){
102 		return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 );
103 	}
toString()104 	public String toString(){
105 		return project+"\t"+source_file+"\t"+dummy1+"\t"+resource_type+"\t"+gid+"\t"
106 		      +lid+"\t"+helpid+"\t"+platform+"\t"+dummy2+"\t"+langid+"\t"
107 		      +text+"\t"+helptext+"\t"+quickhelptext+"\t"+title+"\t"+date;
108 	}
getId()109 	public String getId(){
110 		return project+gid+lid+source_file+resource_type+platform+helpid;
111 	}
112 
getDummy1()113 	public String getDummy1() {
114 		return dummy1;
115 	}
116 
setDummy1(String dummy1)117 	public void setDummy1(String dummy1) {
118 		this.dummy1 = dummy1;
119 	}
120 
getPlatform()121 	public String getPlatform() {
122 		return platform;
123 	}
124 
setPlatform(String platform)125 	public void setPlatform(String platform) {
126 		this.platform = platform;
127 	}
128 
getDummy2()129 	public String getDummy2() {
130 		return dummy2;
131 	}
132 
setDummy2(String dummy2)133 	public void setDummy2(String dummy2) {
134 		this.dummy2 = dummy2;
135 	}
136 
getGid()137 	public String getGid() {
138 		return gid;
139 	}
140 
setGid(String gid)141 	public void setGid(String gid) {
142 		this.gid = gid;
143 	}
144 
getHelpid()145 	public String getHelpid() {
146 		return helpid;
147 	}
148 
setHelpid(String helpid)149 	public void setHelpid(String helpid) {
150 		this.helpid = helpid;
151 	}
152 
getHelptext()153 	public String getHelptext() {
154 		return helptext;
155 	}
156 
setHelptext(String helptext)157 	public void setHelptext(String helptext) {
158 		this.helptext = helptext;
159 	}
160 
getLangid()161 	public String getLangid() {
162 		return langid;
163 	}
164 
setLangid(String langid)165 	public void setLangid(String langid) {
166 		this.langid = langid;
167 	}
168 
getLid()169 	public String getLid() {
170 		return lid;
171 	}
172 
setLid(String lid)173 	public void setLid(String lid) {
174 		this.lid = lid;
175 	}
176 
getProject()177 	public String getProject() {
178 		return project;
179 	}
180 
setProject(String project)181 	public void setProject(String project) {
182 		this.project = project;
183 	}
184 
getQuickhelptext()185 	public String getQuickhelptext() {
186 		return quickhelptext;
187 	}
188 
setQuickhelptext(String quickhelptext)189 	public void setQuickhelptext(String quickhelptext) {
190 		this.quickhelptext = quickhelptext;
191 	}
192 
getResource_type()193 	public String getResource_type() {
194 		return resource_type;
195 	}
196 
setResource_type(String resource_type)197 	public void setResource_type(String resource_type) {
198 		this.resource_type = resource_type;
199 	}
200 
getSource_file()201 	public String getSource_file() {
202 		return source_file;
203 	}
204 
setSource_file(String source_file)205 	public void setSource_file(String source_file) {
206 		this.source_file = source_file;
207 	}
208 
getText()209 	public String getText() {
210 		return text;
211 	}
212 
setText(String text)213 	public void setText(String text) {
214 		this.text = text;
215 	}
216 
getTitle()217 	public String getTitle() {
218 		return title;
219 	}
220 
setTitle(String title)221 	public void setTitle(String title) {
222 		this.title = title;
223 	}
getDate()224 	public String getDate() {
225 		return date;
226 	}
setDate(String date)227 	public void setDate(String date) {
228 		this.date = date;
229 	}
230 
231 
232 }
233