Example usage for org.apache.commons.collections.map MultiKeyMap decorate

List of usage examples for org.apache.commons.collections.map MultiKeyMap decorate

Introduction

In this page you can find the example usage for org.apache.commons.collections.map MultiKeyMap decorate.

Prototype

public static MultiKeyMap decorate(AbstractHashedMap map) 

Source Link

Document

Decorates the specified map to add the MultiKeyMap API and fast query.

Usage

From source file:com.nextep.datadesigner.vcs.impl.MergeStrategyDatabase.java

/**
 * Hashes a collection of <code>IReferenceable</code> objects by their reference
 * /*  ww  w  .j  a v  a2  s.c om*/
 * @param <V> type of the collection which must be a subclass of <code>IReferenceable</code>
 * @param refList a collection of <code>IReferenceable</code>
 * @return a Map of the <code>IReferenceable</code> hashed by reference
 */
@SuppressWarnings("unchecked")
protected <V extends IReferenceable> Map<MultiKey, IReferenceable> hashByNameAndType(Collection<V> refList) {
    int size = refList.size();
    Map<MultiKey, IReferenceable> m = MultiKeyMap.decorate(new HashedMap((0 == size ? 1 : size)));

    for (V r : refList) {
        INamedObject o = getNamedObject(r);
        if (isCaseSensitive()) {
            m.put(new MultiKey(o.getName(), getElementType(r)), r);
        } else {
            m.put(new MultiKey(o.getName().toUpperCase(), getElementType(r)), r);
        }
    }
    return m;
}

From source file:org.apache.hadoop.gateway.topology.Topology.java

public Topology() {
    serviceMap = MultiKeyMap.decorate(new HashedMap());
}

From source file:org.pentaho.chart.core.AxisSeriesLinkInfo.java

/**
 * The constructor initializes requisiste data structures
 */
public AxisSeriesLinkInfo() {
    axisSeriesMap = MultiKeyMap.decorate(new LinkedMap());
}