You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by he...@apache.org on 2005/02/01 07:49:08 UTC

svn commit: r149377 - in webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils: ./ CollectionPool.java Constants.java

Author: hemapani
Date: Mon Jan 31 22:49:06 2005
New Revision: 149377

URL: http://svn.apache.org/viewcvs?view=rev&rev=149377
Log:
use HashMaps to handle the attributes and Namesapce

Added:
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/CollectionPool.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/Constants.java

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/CollectionPool.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/CollectionPool.java?view=auto&rev=149377
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/CollectionPool.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/CollectionPool.java Mon Jan 31 22:49:06 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.impl.utils;
+
+import java.util.HashMap;
+import java.util.Stack;
+
+public class CollectionPool {
+	private static Stack hashMaps = new Stack();
+	public static final HashMap createHashMap(int size) {
+		if (hashMaps.isEmpty()) {
+			return new HashMap(size);
+		} else {
+			return (HashMap) hashMaps.pop();
+		}
+	}
+	public static final HashMap returnHashMap(HashMap map) {
+		map.clear();
+		return (HashMap) hashMaps.push(map);
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/Constants.java?view=auto&rev=149377
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/Constants.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/utils/Constants.java Mon Jan 31 22:49:06 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.impl.utils;
+
+import java.util.Iterator;
+
+public class Constants {
+	public static final Iterator EMPTY_ITERATOR = new Iterator() {
+		public void remove() {
+			throw new UnsupportedOperationException();
+		}
+
+		public boolean hasNext() {
+			return false;
+		}
+
+		public Object next() {
+			throw new UnsupportedOperationException();
+		}
+	};
+}