Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    /**
     * Busca por um determinado string numa tabela de espalhamento
     * 
     * @param map
     * @param newString
     * @return
     */
    public static String searchStrStr(Map<String, String> map, String newString) {
        String foundedString = null;

        for (Map.Entry<String, String> entry : map.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();

            if (key.equals(newString)) {
                foundedString = value;
                break;
            }
        }

        return foundedString;
    }
}