Subversion Repositories SmartDukaan

Rev

Rev 88 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88 Rev 91
Line 45... Line 45...
45
	 * Hashtable of Feature Definition ID to list of learned Bullet objects
45
	 * Hashtable of Feature Definition ID to list of learned Bullet objects
46
	 */
46
	 */
47
	private Map<Long, List<ExpandedBullet>> learnedBullets;
47
	private Map<Long, List<ExpandedBullet>> learnedBullets;
48
	
48
	
49
	/**
49
	/**
-
 
50
	 * Hashtable of Facet Definition ID to list of unique facet values found 
-
 
51
	 * across entities
-
 
52
	 */
-
 
53
	private Map<Long, List<String>> facetDefinitionIDFacetValues;
-
 
54
	
-
 
55
	/**
50
	 * Instantiates required data structures only when needed
56
	 * Instantiates required data structures only when needed
51
	 */
57
	 */
52
	public EntityContainer() {
58
	public EntityContainer() {
53
		// Lazy initialization
59
		// Lazy initialization
54
	}
60
	}
Line 204... Line 210...
204
		
210
		
205
		ExpandedEntity expEntity = new ExpandedEntity(entity);
211
		ExpandedEntity expEntity = new ExpandedEntity(entity);
206
		
212
		
207
		return expEntity;
213
		return expEntity;
208
	}
214
	}
-
 
215
 
-
 
216
	
-
 
217
	/**
-
 
218
	 * Returns hashtable of list facet values to facet definition ID
-
 
219
	 * 
-
 
220
	 * @return
-
 
221
	 * @throws Exception
-
 
222
	 */
-
 
223
	@SuppressWarnings("unchecked")
-
 
224
	public Map<Long, List<String>> getFacetValues() throws Exception {
-
 
225
		// De-serialize
-
 
226
		if(this.facetDefinitionIDFacetValues == null) {
-
 
227
			String dbFile = Utils.ENTITIES_DB_PATH + "facetvalues.ser";
-
 
228
			
-
 
229
			this.facetDefinitionIDFacetValues = 
-
 
230
				(Map<Long, List<String>>) DBUtils.read(dbFile);
-
 
231
		}
-
 
232
		
-
 
233
		if(this.facetDefinitionIDFacetValues == null) {
-
 
234
			this.facetDefinitionIDFacetValues = new HashMap<Long, 
-
 
235
				List<String>>();
-
 
236
		}
-
 
237
		
-
 
238
		return this.facetDefinitionIDFacetValues;
-
 
239
	}
-
 
240
	
-
 
241
	/**
-
 
242
	 * Returns list of facet values for a facet definition ID
-
 
243
	 * 
-
 
244
	 * @param facetDefinitionID
-
 
245
	 * @return List<String> 
-
 
246
	 * @throws Exception
-
 
247
	 */
-
 
248
	public List<String> getFacetValues(long facetDefinitionID) 
-
 
249
		throws Exception {
-
 
250
		this.getFacetValues();
-
 
251
		
-
 
252
		return this.facetDefinitionIDFacetValues.get(
-
 
253
				new Long(facetDefinitionID));
-
 
254
	}
209
	
255
	
210
	/**
256
	/**
211
	 * Utility method to find out Feature object in Entity instance
257
	 * Utility method to find out Feature object in Entity instance
212
	 * 
258
	 * 
213
	 * @param entityID
259
	 * @param entityID