[Mydm-cvs] MyDM/src/java/org/mydm/core MetaData.java,1.13,1.14
Status: Pre-Alpha
Brought to you by:
vkdasari
From: Vijay <vkd...@us...> - 2004-03-16 15:58:56
|
Update of /cvsroot/mydm/MyDM/src/java/org/mydm/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32312/src/java/org/mydm/core Modified Files: MetaData.java Log Message: Added searchable elements Index: MetaData.java =================================================================== RCS file: /cvsroot/mydm/MyDM/src/java/org/mydm/core/MetaData.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MetaData.java 4 Mar 2004 21:39:59 -0000 1.13 --- MetaData.java 16 Mar 2004 15:49:35 -0000 1.14 *************** *** 52,55 **** --- 52,61 ---- private static HashMap allelehash = new HashMap(); + /** Contains all metadata elements to their general labels */ + private static HashMap alleleToLabel = new HashMap(); + + /** Contains all metadata elements which are searchable to their label */ + private static HashMap alleleToSearchable = new HashMap(); + /** Hashmap of all metadata elements to their value types */ private static HashMap allelevalueType = new HashMap(); *************** *** 104,107 **** --- 110,123 ---- child.getAttributeValue("dbelename")); + // push the name and the label of all elements + alleleToLabel.put(child.getAttributeValue("name"), + child.getAttributeValue("label")); + + // push to searchable elements if the searchable flag is true + if(child.getAttributeValue("searchable").equals("true")){ + alleleToSearchable.put(child.getAttributeValue("name"), + child.getAttributeValue("label")); + } + // Push the element name to its valuetype map allelevalueType.put(child.getAttributeValue("name"), *************** *** 311,314 **** --- 327,364 ---- /** + * Gets back the HashMap of Metdata elements to their labels. + * <p> + * Mapping <br/> + * elementname => element label + * + * @return alleleToLabel + */ + public static HashMap getAllEleToLabel(){ + return alleleToLabel; + } + + /** + * Gets back the label of the given element + * + * @param hele metadata element + * @return label of the metadata element + */ + public static String getLabelOfElement(String hele){ + return alleleToLabel.get(hele).toString(); + } + + /** + * Gets back the HashMap of all searchable elements. + * <p> + * Mapping <br/> + * elementname => element label + * + * @return alleleToSearchable + */ + public static HashMap getAllSearchableElements(){ + return alleleToSearchable; + } + + /** * Gets back the HashMap of Metadata elements to their value types. * <p> |