Example usage for java.util HashMap get

List of usage examples for java.util HashMap get

Introduction

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

Prototype

public V get(Object key) 

Source Link

Document

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Usage

From source file:es.pode.soporte.auditoria.registrar.Registrar.java

/**
 * Registro de la operacin previsualizar
 *    @param valores Tabla con los valores capturados
 *  @param destino Operacin realizada//from   w w w.  j a  va 2  s .com
 */
public static void operacionPrevisualizar(DatosVO datosInterceptados) throws Exception {

    String moduloDestino = datosInterceptados.getModuloDestino();
    HashMap valores = datosInterceptados.getValores();

    String idODE = (String) valores.get(RegistroCtes.PARAMETRO_IDENTIFICADOR);
    String idioma = (String) valores.get(RegistroCtes.PARAMETRO_IDIOMA);

    registrarOperacion(idODE, idioma, moduloDestino);
}

From source file:es.pode.soporte.auditoria.registrar.Registrar.java

/**
* Registro de la operacin de envo de correo
*    @param valores Tabla con los valores capturados
*  @param destino Operacin realizada//from w w w . j a v  a 2s.c  o m
*/
public static void operacionEnviarCorreo(DatosVO datosInterceptados) throws Exception {

    String moduloDestino = datosInterceptados.getModuloDestino();
    HashMap valores = datosInterceptados.getValores();

    String idODE = (String) valores.get(RegistroCtes.PARAMETRO_IDENTIFICADOR_ODE);
    String idioma = (String) valores.get(RegistroCtes.PARAMETRO_IDIOMA);

    registrarOperacion(idODE, idioma, moduloDestino);
}

From source file:edu.umich.ctools.sectionsUtilityTool.Friend.java

public static String replacePlaceHolders(String message, HashMap<String, String> map) {

    Iterator<String> keySetIterator = map.keySet().iterator();

    while (keySetIterator.hasNext()) {
        String key = keySetIterator.next();
        message = message.replace(key, map.get(key));
    }/*from   w w  w. j  av a2s .  c  om*/

    return message;
}

From source file:es.pode.soporte.auditoria.registrar.Registrar.java

/**
 * Registro de la operacin descargados//from   www  .  j a  va  2s. com
 *    @param valores Tabla con los valores capturados
 *  @param destino Operacin realizada
 */
public static void operacionDescargado(DatosVO datosInterceptados) throws Exception {

    String moduloDestino = datosInterceptados.getModuloDestino();
    HashMap valores = datosInterceptados.getValores();

    String idODE = (String) valores.get(RegistroCtes.PARAMETRO_ID_ODE);
    String idioma = (String) valores.get(RegistroCtes.PARAMETRO_IDIOMA);//En la operacin de solicitar metadato(ficha) nos interesa el idioma de bsqueda
    String tipoPIF = (String) valores.get(RegistroCtes.PARAMETRO_TIPO_PIF); // En la operacin descargado de ODE tambin interesa el tipo de descarga         

    registrarOperacion(idODE, idioma, moduloDestino + SEPARADOR + tipoPIF);
}

From source file:Main.java

public static String generateBgsid(HashMap hashmap) {
    StringBuffer stringbuffer = new StringBuffer();
    ArrayList arraylist = new ArrayList();
    for (Iterator iterator = hashmap.entrySet().iterator(); iterator.hasNext(); arraylist
            .add(((java.util.Map.Entry) iterator.next()).getKey())) {
    }/*from   ww  w  .jav a2  s . c  o  m*/
    Collections.sort(arraylist, String.CASE_INSENSITIVE_ORDER);
    for (Iterator iterator1 = arraylist.iterator(); iterator1.hasNext(); stringbuffer
            .append((String) hashmap.get((String) iterator1.next()))) {
    }
    stringbuffer.append("c18c24046606b2e084edd37f9fe9f94d");
    return md5(stringbuffer.toString());
}

From source file:info.mtgdb.api.Db.java

/**
 * /*  w  w w . j  av a  2s .  c o  m*/
 * @param filters HashMap<String, String> containing a mapping of keys to values.  For example colors and black.
 * @return ArrayList
 */
public static ArrayList<Card> filterCards(HashMap<String, String> filters) {
    StringBuilder sb = new StringBuilder();
    sb.append(API_URL + "/cards/?");
    for (String key : filters.keySet()) {
        String value = filters.get(key);
        sb.append(key + "=" + value + "&");
    }
    if (filters.size() > 0)
        sb.deleteCharAt(sb.length() - 1);
    return getCardsFromUrl(sb.toString());
}

From source file:br.edu.ufcg.supervisor.engine.Simulation.java

public static void executeModel(JSONObject r, Automaton model, HashMap<String, Float> map1,
        HashMap<Integer, Float> map2, String currentState, String recommendation, String logString)
        throws Exception {
    ArrayList<String> names = LoadedModel.getNomesVariaveisMonitoradas();
    ArrayList<String> arrayMensagens = new ArrayList<String>();
    for (int i = 0; i < map1.size(); i++) {
        currentState = currentState + "- " + names.get(i) + ": " + map1.get(names.get(i)) + ".<br>";
    }/*  ww  w.j  av a2 s  .co m*/

    logString = logString + currentState + " - ";
    r.put("cur", currentState);

    State estado = model.buscaEstadoCorrespondente(map2);
    if (!(estado.getClassificacao() == State.INT_CL_ACEITACAO)) {
        Search alg = new Search(model);
        alg.execute(estado);
        for (State estadoAceito : model.getArrayEstadosAceitos()) {
            LinkedList<State> caminho = alg.getPath(estadoAceito);
            if (caminho != null) {
                for (int j = 0; j < caminho.size() - 1; j++)
                    recommendation += "." + model.getMensagemDasTransicoesEntreDoisEstadosQuaisquer(
                            caminho.get(j), caminho.get(j + 1));//elthon
                arrayMensagens.add(recommendation);
            }
        }
        recommendation = getShortestPath(arrayMensagens);
        recommendation = eliminateReplicatedRecommendations(recommendation);
        if (recommendation.equals("."))
            recommendation = "Some variable has not been measured!";
        logString = logString + recommendation + "\n";
    } else {
        recommendation = "Keep going!";
        logString = logString + "(" + recommendation + ")\n";
    }
    r.put("rec", recommendation);
}

From source file:com.microsoft.tfs.core.httpclient.HttpState.java

/**
 * Find matching {@link Credentials credentials} for the given
 * authentication scope.// w  w  w .j  av a  2  s. co  m
 *
 * @param map
 *        the credentials hash map
 * @param token
 *        the {@link AuthScope authentication scope}
 * @return the credentials
 *
 */
private static Credentials matchCredentials(final HashMap<AuthScope, Credentials> map,
        final AuthScope authscope) {
    // see if we get a direct hit
    Credentials creds = map.get(authscope);

    if (creds == null) {
        // Nope.
        // Do a full scan
        int bestMatchFactor = -1;
        AuthScope bestMatch = null;
        final Iterator<AuthScope> items = map.keySet().iterator();
        while (items.hasNext()) {
            final AuthScope current = items.next();
            final int factor = authscope.match(current);
            if (factor > bestMatchFactor) {
                bestMatchFactor = factor;
                bestMatch = current;
            }
        }
        if (bestMatch != null) {
            creds = map.get(bestMatch);
        }
    }
    return creds;
}

From source file:com.marklogic.contentpump.utilities.TransformHelper.java

private static String mapToElement(HashMap<String, String> map) {
    StringBuilder sb = new StringBuilder();
    sb.append(MAP_ELEM_START_TAG);//from  www .ja v  a2  s.com
    Set<String> keys = map.keySet();
    for (String k : keys) {
        addKeyValue(sb, k, map.get(k));
    }
    sb.append("</map:map>");
    return sb.toString();
}

From source file:com.maxleapmobile.gitmaster.ui.fragment.RecommendFragment.java

public static Repo from(HashMap<String, Object> object) throws Exception {
    Repo repo = new Repo();

    repo.setDescription(object.get("description").toString());
    repo.setForksCount(Long.valueOf(object.get("forksCount").toString()));
    repo.setHtmlUrl(object.get("htmlUrl").toString());
    repo.setId(Long.valueOf(object.get("id").toString()));
    repo.setPrivateRepo(Boolean.valueOf(object.get("isPrivate").toString()));
    repo.setLanguage(object.get("language").toString());
    repo.setName(object.get("name").toString());
    Owner owner = new Owner();
    owner.setAvatarUrl(object.get("ownerAvatarUrl").toString());
    owner.setFollowersUrl(object.get("ownerFollowersUrl").toString());
    owner.setFollowingUrl(object.get("ownerFollowingUrl").toString());
    owner.setHtmlUrl(object.get("ownerHtmlUrl").toString());
    owner.setId(Integer.valueOf(object.get("ownerId").toString()));
    owner.setLogin(object.get("ownerLogin").toString());
    owner.setReposUrl(object.get("ownerReposUrl").toString());
    repo.setOwner(owner);/*ww w. j a  va  2  s .c om*/
    repo.setStargazersCount(Long.valueOf(object.get("stargazersCount").toString()));

    return repo;
}