Example usage for org.eclipse.jface.viewers CustomHashtable get

List of usage examples for org.eclipse.jface.viewers CustomHashtable get

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers CustomHashtable get.

Prototype

public Object get(Object key) 

Source Link

Document

Answers the value associated with the specified key in this Hashtable.

Usage

From source file:org.eclipse.php.internal.ui.util.MultiElementSelection.java

License:Open Source License

private CustomHashtable createTreePathMap(IElementComparer comparer) {
    CustomHashtable result = new CustomHashtable(comparer);
    for (int i = 0; i < fAllTreePaths.length; i++) {
        TreePath path = fAllTreePaths[i];
        Object key = path.getLastSegment();
        if (key != null) {
            Object value = result.get(key);
            if (value == null) {
                result.put(key, path);/* ww w.j  a  va 2 s. c o  m*/
            } else if (value instanceof TreePath) {
                List l = new ArrayList();
                l.add(value);
                l.add(path);
                result.put(key, l);
            } else if (value instanceof List) {
                ((List) value).add(path);
            } else {
                Assert.isTrue(false, "Should not happen"); //$NON-NLS-1$
            }
        }
    }
    return result;
}