xref: /AOO41X/main/l10ntools/java/receditor/java/transex3/model/ResourceFile.java (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 package transex3.model;
2 
3 import java.util.*;
4 
5 public class ResourceFile {
6 	Vector 		sdfStrings		= new Vector();
7 	HashMap		sdfHashMap		= new HashMap();
8 	String filepathid			= null;
9 	String modulename			= null;
10 	String filename				= null;
11 
12 
13 	public String getModuleName(){
14 		return modulename;
15 	}
16 	public String getFilePath(){
17 		return filepathid;
18 	}
19 	public String getFileName(){
20 		return filename;
21 	}
22 /*	public List readSoureStrings( java.io.File aSdfFile ){
23 		List sdfList=null;
24 		return sdfList;
25 	};*/
26 	public void addString( SdfString aSdfstring ){
27 		sdfStrings.add( aSdfstring );
28 		sdfHashMap.put( aSdfstring.getFileId() , aSdfstring );
29 		if( filepathid == null )
30 			filepathid = aSdfstring.getFilePath();
31 		if( modulename == null )
32 			modulename = aSdfstring.getModuleName();
33 		if( filename == null )
34 			filename = aSdfstring.getFileName();
35 	}
36 
37 
38 	public void ParseString( String aSourceString ){
39 		//sourceString 			= new SdfEntity();
40 		SdfEntity aSdfEntity 	= new SdfEntity();
41 		aSdfEntity.setProperties( aSourceString );
42 		SdfString sdfstring		= null;
43 		if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ){
44 			sdfstring = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() );
45 		}
46 		else
47 		{
48 			sdfstring = new SdfString();
49 			addString( sdfstring );
50 		}
51 		sdfstring.addLanguageString( aSdfEntity );
52 
53 
54 	}
55 	/*public void ParseSdfFile( java.util.Vector aSdfList ){
56 		ListIterator aLI = aSdfList.listIterator();
57 		String current;
58 		String[] splitted;
59 		SdfEntity aSdfEntity;
60 		SdfString aSdfString = new SdfString();
61 		while( aLI.hasNext() ){
62 			aSdfEntity = new SdfEntity();
63 			aSdfEntity.setProperties( (String) aLI.next() );
64 			SdfString aString;
65 
66 			if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) )
67 				aString = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() );
68 			else
69 			{
70 				aString = new SdfString();
71 				addString( aString );
72 			}
73 			aString.addLanguageString( aSdfEntity );
74 		}
75 
76 	}*/
77 }
78