Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2002, 2006 Object Factory Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Object Factory Inc. - Initial implementation IBM Corporation - fix for Bug 110636 /
package org.eclipse.ant.internal.ui.dtd.util;
Can be inherited or used statically.

Author(s):
Bob Foster
public class SortedMapFactory {
	private static class IndirectStringComparator implements Comparator {
		public int compare(Object o1Object o2) {
			return o1.toString().compareTo(o2.toString());
		}
	}
    
	private static final Factory fFactory = new Factory();
	public static SortedMap getMap(IMapHolder holderComparator comp) {
		if (map == null)
			map = new SortedMap();
		map.setMapHolder(holder);
		map.setComparator(comp);
		return map;
	}
	public static SortedMap getIndirectStringMap(IMapHolder holder) {
		return getMap(holder);
	}
	public static void freeMap(SortedMap map) {
		map.setComparator(null);
		map.setMapHolder(null);
	}
New to GrepCode? Check out our FAQ X