Example usage for java.util TreeMap TreeMap

List of usage examples for java.util TreeMap TreeMap

Introduction

In this page you can find the example usage for java.util TreeMap TreeMap.

Prototype

public TreeMap() 

Source Link

Document

Constructs a new, empty tree map, using the natural ordering of its keys.

Usage

From source file:com.ejisto.util.collector.MockedFieldCollector.java

@Override
public BinaryOperator<Map<String, List<MockedField>>> combiner() {
    return (m1, m2) -> {
        Map<String, List<MockedField>> result = new TreeMap<>();
        result.putAll(m1);//  w  ww  . j  av  a 2 s  .  c  o  m
        m2.entrySet().stream().forEach(e -> result.merge(e.getKey(), e.getValue(), ListUtils::union));
        return result;
    };
}

From source file:com.cloudhopper.sxmp.OptionalParamMap.java

/**
 * Create an optional param map based on the specified map type
 * @param type/*  w  ww . java2s . c  o  m*/
 * @throws IllegalArgumentException
 */
public OptionalParamMap(int type) throws IllegalArgumentException {
    switch (type) {
    case HASH_MAP:
        map = new HashMap<String, Object>();
        break;
    case TREE_MAP:
        map = new TreeMap<String, Object>();
        break;
    default:
        throw new IllegalArgumentException("Invalid map type");
    }
}

From source file:com.salesmanager.central.web.MenuFactory.java

public void setFunctionsByFunctionCode(Collection functions) {

    if (functions != null) {
        // functionsByFunctionCode = functions;
        functionsByFunctionCode = new TreeMap();
        Iterator i = functions.iterator();
        while (i.hasNext()) {
            CentralFunction cf = (CentralFunction) i.next();
            functionsByFunctionCode.put(cf.getCentralFunctionCode(), cf);
        }//from  ww w . j a  v  a2s. c o m
    }

}

From source file:org.socialhistoryservices.pid.controllers.AccessConfirmationController.java

@RequestMapping("/oauth/confirm_access")
public ModelAndView getAccessConfirmation(UnconfirmedAuthorizationCodeClientToken clientAuth) throws Exception {
    ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
    TreeMap<String, Object> model = new TreeMap<String, Object>();
    model.put("auth_request", clientAuth);
    model.put("client", client);
    return new ModelAndView("access_confirmation", model);
}

From source file:com.expedia.seiso.web.jackson.hal.HalResourceAssembler.java

public HalResource toHalPagedResources(@NonNull PagedResources pagedResources) {
    val halPagedResources = new HalResource();
    halPagedResources.setLinks(toHalLinks(pagedResources.getLinks(), true));
    halPagedResources.setEmbedded(toHalEmbeddedItems(pagedResources.getItems()));

    // State (page metadata)
    val state = new TreeMap<String, Object>();
    state.put("metadata", pagedResources.getMetadata());
    halPagedResources.setState(state);// ww w . j a v a  2  s. c  o  m

    return halPagedResources;
}

From source file:com.espertech.esper.filter.FilterParamIndexCompare.java

public FilterParamIndexCompare(FilterSpecLookupable lookupable, FilterOperator filterOperator) {
    super(filterOperator, lookupable);

    constantsMap = new TreeMap<Object, EventEvaluator>();
    constantsMapRWLock = new ReentrantReadWriteLock();

    if ((filterOperator != FilterOperator.GREATER) && (filterOperator != FilterOperator.GREATER_OR_EQUAL)
            && (filterOperator != FilterOperator.LESS) && (filterOperator != FilterOperator.LESS_OR_EQUAL)) {
        throw new IllegalArgumentException("Invalid filter operator for index of " + filterOperator);
    }//from w  w  w. j  a va2 s .  com
}

From source file:ca.on.gov.jus.icon.common.iconcodetables.IconCodeTablesManager.java

private IconCodeTablesManager() {
    logger.info("IN IconCodeTablesManager::IconCodeTablesManager");
    iconCodeTables = new TreeMap();
    populateHardcodedTables();//from   ww w  . j  a va  2s  .co m

    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (null != facesContext) {
        Map applicationScope = (Map) facesContext.getApplication().createValueBinding("#{applicationScope}")
                .getValue(facesContext);

        applicationScope.put("iconCodeTablesManager", this);
    }
}

From source file:epgtools.epgdbbean.bean.channel.ChannelGetter.java

/**
 * DB?????????/*from   w w w . j  ava  2s  . c om*/
 *
 * @return ??????(??) ?????
 * @throws java.sql.SQLException
 */
public synchronized Map<Integer, Useablechannels_ReadOnly> getChannels() throws SQLException {
    //?
    Map<Integer, Useablechannels> Channels;
    Channels = Collections.synchronizedMap(runner.query(con, ChannelGetter.GET_CHANNELS,
            new BeanMapHandler<Integer, Useablechannels>(Useablechannels.class, "channel_no")));
    Map<Integer, Useablechannels_ReadOnly> Channels_Ro;
    Channels_Ro = Collections.synchronizedMap(new TreeMap<Integer, Useablechannels_ReadOnly>());
    Channels_Ro.putAll(Channels);
    return Collections.unmodifiableMap(Channels_Ro);
}

From source file:com.cloud.bridge.util.EC2RestAuth.java

public EC2RestAuth() {
    // these must be lexicographically sorted
    queryParts = new TreeMap<String, String>();
}

From source file:com.wadpam.guja.oauth2.social.NetworkTemplate.java

public static Map<String, String> asMap(String... nameValues) {
    final TreeMap<String, String> map = new TreeMap<String, String>();

    if (null != nameValues) {
        for (int i = 0; i + 1 < nameValues.length; i += 2) {
            map.put(nameValues[i], nameValues[i + 1]);
        }/*from www .j  a va 2s  .c o  m*/
    }

    return map;
}