incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daw...@apache.org
Subject svn commit: r945357 - /incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java
Date Mon, 17 May 2010 20:38:04 GMT
Author: dawood
Date: Mon May 17 20:38:03 2010
New Revision: 945357

URL: http://svn.apache.org/viewvc?rev=945357&view=rev
Log:
Add getClassNameOfInstance()

Modified:
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java?rev=945357&r1=945356&r2=945357&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/AnchorData.java
Mon May 17 20:38:03 2010
@@ -131,6 +131,28 @@ public class AnchorData 
 		return instanceInfoList;
 	}
 	
+	/**
+	 * Get the anchor class name associated with the given instance name.
+	 * @param instanceName
+	 * @return null if not found.
+	 */
+	public String getClassNameOfInstance(String instanceName) {
+		Iterator iter = _classNameToInstanceInfoListMap.keySet().iterator();
+		while (iter.hasNext()) {
+			String className = (String)iter.next();
+			List instanceInfoList = getInstanceInfoList(className);
+			Iterator iter2 = instanceInfoList.iterator();
+			while (iter2.hasNext()) {
+				InstanceInfo info = (InstanceInfo)iter2.next();
+				if (info.getInstanceName().equals(instanceName)) {
+					return className;
+				}
+			}
+		}
+		return null;
+	}
+	
+	
 	public void addInstanceInfoListForClass(String className, List instanceInfoList)
 	{
 		_classNameToInstanceInfoListMap.put(className, instanceInfoList);



Mime
View raw message