Example usage for com.google.common.collect Maps newHashMap

List of usage examples for com.google.common.collect Maps newHashMap

Introduction

In this page you can find the example usage for com.google.common.collect Maps newHashMap.

Prototype

public static <K, V> HashMap<K, V> newHashMap() 

Source Link

Document

Creates a mutable, empty HashMap instance.

Usage

From source file:com.cognifide.aet.executor.xmlparser.xml.BasicPhaseConverter.java

static Map<String, String> getParameters(InputNode inputNode) throws ParseException {
    Map<String, String> parameters = Maps.newHashMap();
    try {// ww w.  j  av  a  2  s  . c  o m
        for (String name : inputNode.getAttributes()) {
            String value = inputNode.getAttribute(name).getValue();
            parameters.put(name, value);
        }
    } catch (Exception e) {
        throw new ParseException(e.getMessage(), e);
    }
    return parameters;
}

From source file:interactivespaces.master.api.messages.MasterApiMessageSupport.java

/**
 * Get the simple version of a Master API success response.
 *
 * @return a success API response//w  ww .  j a  v a 2s .  c om
 */
public static Map<String, Object> getSimpleSuccessResponse() {
    Map<String, Object> response = Maps.newHashMap();

    response.put(MasterApiMessages.MASTER_API_MESSAGE_ENVELOPE_RESULT,
            MasterApiMessages.MASTER_API_RESULT_SUCCESS);

    return response;
}

From source file:se.uu.it.cs.recsys.dataloader.correction.CourseNameCorrectionGenerator.java

public static Map<String, String> getWrongToCorrectNamePairs() {
    Map<String, String> wrongToCorrect = Maps.newHashMap();

    wrongToCorrect.put("Algorithms and Data Structures 111", "Algorithms and Data Structures III");
    wrongToCorrect.put("Operating Systems 1", "Operating Systems I");
    wrongToCorrect.put("Data Mining .", "Data Mining");
    wrongToCorrect.put("Data Mining ,", "Data Mining");
    wrongToCorrect.put("Database Design 1", "Database Design I");
    wrongToCorrect.put("Database Design !", "Database Design I");
    wrongToCorrect.put("Database Design 1 ,", "Database Design I");
    wrongToCorrect.put("Compiler Design 1", "Compiler Design I");
    wrongToCorrect.put("Project CS .", "Project CS");
    wrongToCorrect.put("Computer Networks 1", "Computer Networks I");
    wrongToCorrect.put("Computer Networks!", "Computer Networks I");
    wrongToCorrect.put("Test [Methodology", "Test Methodology");
    wrongToCorrect.put("Real Time Systems 1", "Real Time Systems I");
    wrongToCorrect.put("Rea! Time Systems 1", "Real Time Systems I");
    wrongToCorrect.put("User Interface Programming 1", "User Interface Programming I");
    wrongToCorrect.put("User Interface Programming ]l", "User Interface Programming II");
    wrongToCorrect.put("User Interface Programming l(", "User Interface Programming II");
    wrongToCorrect.put("User Interface Programming 11", "User Interface Programming II");
    wrongToCorrect.put("User Interface Programming!!", "User Interface Programming II");
    wrongToCorrect.put("High Performance Computing.and Programming",
            "High Performance Computing and Programming");
    wrongToCorrect.put("Methods of programming DV2 ?", "Methods of programming DV2");
    wrongToCorrect.put("Database Design 11", "Database Design II");
    wrongToCorrect.put("Database Design I!", "Database Design II");
    wrongToCorrect.put("Database Design li", "Database Design II");
    wrongToCorrect.put("Database Design I1", "Database Design II");
    wrongToCorrect.put("Compiler Design 11", "Compiler Design II");
    wrongToCorrect.put("Compiler Design I1", "Compiler Design II");
    wrongToCorrect.put("Database Design I ,", "Database Design I");
    wrongToCorrect.put("Secure Computer Systems 1", "Secure Computer Systems I");
    wrongToCorrect.put("Secure Computer Systems 1!", "Secure Computer Systems II");
    wrongToCorrect.put("Secure Computer Systems 11", "Secure Computer Systems II");
    wrongToCorrect.put("Secure Computer Systems I!", "Secure Computer Systems II");
    wrongToCorrect.put("Secure Computer Systems I1", "Secure Computer Systems II");
    wrongToCorrect.put("Data Mining 1", "Data Mining I");
    wrongToCorrect.put("Data Mining i", "Data Mining I");
    wrongToCorrect.put("Advanced Algorlthmics", "Advanced Algorithmics");
    wrongToCorrect.put("Computer Networks 11", "Computer Networks II");
    wrongToCorrect.put("Computer Networks I1", "Computer Networks II");
    wrongToCorrect.put("3rogramming of Parallel Computers", "Programming of Parallel Computers");
    wrongToCorrect.put("Algorithms and Data Structures 11", "Algorithms and Data Structures II");
    wrongToCorrect.put("Algorithms and Data Structures li", "Algorithms and Data Structures II");
    wrongToCorrect.put("Algorithms and Data Structures K", "Algorithms and Data Structures II");
    wrongToCorrect.put("Algorithms and Data Structures 1)", "Algorithms and Data Structures II");
    wrongToCorrect.put("Algorithms and Data Structures 1!", "Algorithms and Data Structures II");
    wrongToCorrect.put("Computer Networks 111", "Computer Networks III");
    wrongToCorrect.put("Computer Networks I11", "Computer Networks III");
    wrongToCorrect.put("Computer Networks II1", "Computer Networks III");
    wrongToCorrect.put("Functional Programming I .", "Functional Programming I");
    wrongToCorrect.put("Rea! Time Systems", "Real Time Systems");
    wrongToCorrect.put("Real Time Systems IV1N1", "Real Time Systems MN1");
    wrongToCorrect.put("Real Time Systems MNl", "Real Time Systems MN1");
    wrongToCorrect.put("Artificial intelligence", "Artificial Intelligence");
    wrongToCorrect.put("Data Mining 11", "Data Mining II");
    wrongToCorrect.put("Data Mining 1!", "Data Mining II");
    wrongToCorrect.put("Data Mining If", "Data Mining II");
    wrongToCorrect.put("Computer Networks 1", "Computer Networks I");
    wrongToCorrect.put("Computer Networks!", "Computer Networks I");
    wrongToCorrect.put("Computer Networks 11", "Computer Networks II");
    wrongToCorrect.put("Computer Networks [[", "Computer Networks II");
    wrongToCorrect.put("Computer Architecture II ?.", "Computer Architecture II");
    wrongToCorrect.put("Computer Architecture 11", "Computer Architecture II");
    wrongToCorrect.put("Algorithms and Data Structures 1", "Algorithms and Data Structures I");
    wrongToCorrect.put("Functional Programming 1", "Functional Programming I");
    wrongToCorrect.put("Functional Programming 1 .", "Functional Programming I");
    wrongToCorrect.put("Functional Programming!", "Functional Programming I");
    wrongToCorrect.put("Computer Assisted Image Analysis 11", "Computer Assisted Image Analysis II");
    wrongToCorrect.put("Scientific Computing 1", "Scientific Computing I");
    wrongToCorrect.put("Computer Games Development 1", "Computer Games Development I");
    wrongToCorrect.put("Computer Games Development!", "Computer Games Development I");
    wrongToCorrect.put("Degree Project H in Computer Science", "Degree Project E in Computer Science");
    wrongToCorrect.put("DegreekPro]ect E in Computer Science", "Degree Project E in Computer Science");
    wrongToCorrect.put("Degree Project E in Computer Science .", "Degree Project E in Computer Science");
    wrongToCorrect.put("Advanced Computer Architecture ?", "Advanced Computer Architecture");
    wrongToCorrect.put("Computer Assisted Image Analysis 1", "Computer Assisted Image Analysis I");
    wrongToCorrect.put("Computer Assisted [mage Analysis 1", "Computer Assisted Image Analysis I");
    wrongToCorrect.put("Computing Education Research '", "Computing Education Research");
    wrongToCorrect.put("Compiler Design 1", "Compiler Design I");
    wrongToCorrect.put("Compiler Design!", "Compiler Design I");
    wrongToCorrect.put("Compiler Design 1 -", "Compiler Design I");
    wrongToCorrect.put("Compiler Design I -", "Compiler Design I");
    wrongToCorrect.put("Advanced Computer Science Studies In Sweden",
            "Advanced Computer Science Studies in Sweden");
    wrongToCorrect.put("ProgrammingTheory", "Programming Theory");

    return wrongToCorrect;
}

From source file:com.querydsl.apt.SpatialSupport.java

private static void registerTypes(TypeMappings typeMappings) {
    Map<String, String> additions = Maps.newHashMap();
    additions.put("Geometry", "GeometryPath");
    additions.put("GeometryCollection", "GeometryCollectionPath");
    additions.put("LinearRing", "LinearRingPath");
    additions.put("LineString", "LineStringPath");
    additions.put("MultiLineString", "MultiLineStringPath");
    additions.put("MultiPoint", "MultiPointPath");
    additions.put("MultiPolygon", "MultiPolygonPath");
    additions.put("Point", "PointPath");
    additions.put("Polygon", "PolygonPath");
    additions.put("PolyHedralSurface", "PolyhedralSurfacePath");
    for (Map.Entry<String, String> entry : additions.entrySet()) {
        typeMappings.register(new SimpleType("org.geolatte.geom." + entry.getKey()),
                new SimpleType("com.querydsl.spatial." + entry.getValue()));
    }//from w  ww  . jav  a  2  s  .c  om
}

From source file:com.cloudera.exhibit.core.multi.MultiExhibitStore.java

public static MultiExhibitStore create(List<ExhibitStore> stores) {
    Map<String, ExhibitStore> storeMap = Maps.newHashMap();
    for (ExhibitStore store : stores) {
        for (String entity : store.entities()) {
            // TODO double check this
            storeMap.put(entity, store);
        }/*from  w  w  w.  j ava 2  s.  com*/
    }
    return new MultiExhibitStore(storeMap);
}

From source file:com.aliyun.odps.ogg.handler.datahub.operations.OperationHandlerManager.java

public static void init() {
    handlers = Maps.newHashMap();

    DeleteOperationHandler deleteOperationHandler = new DeleteOperationHandler();
    InsertOperationHandler insertOperationHandler = new InsertOperationHandler();
    UpdateOperationHandler updateOperationHandler = new UpdateOperationHandler();

    handlers.put(DsOperation.OpType.DO_INSERT, insertOperationHandler);
    handlers.put(DsOperation.OpType.DO_UPDATE, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_UPDATE_AC, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_UPDATE_FIELDCOMP, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_UPDATE_FIELDCOMP_PK, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_UNIFIED_UPDATE_VAL, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_UNIFIED_PK_UPDATE_VAL, updateOperationHandler);
    handlers.put(DsOperation.OpType.DO_DELETE, deleteOperationHandler);
}

From source file:org.openqa.selenium.remote.CoordinatesUtils.java

static Map<String, Object> paramsFromCoordinates(Coordinates where) {
    Map<String, Object> params = Maps.newHashMap();

    if (where != null) {
        String id = (String) where.getAuxiliary();
        params.put("element", id);
    }/*from   ww w  . j  a  v a  2s  .c o  m*/

    return params;
}

From source file:com.quartz.web.util.QuartzUtil.java

/**
 * ?QuartzUtil to Map<String,String>
 *
 * @param paramList//from w ww.  ja  v a  2s  .c o m
 * @return
 */
public static Map<String, String> getParaMap(List<QuartzParam> paramList) {
    Map<String, String> params = Maps.newHashMap();
    if (paramList != null) {
        for (QuartzParam quartzParam : paramList) {
            params.put(quartzParam.getParaname(), quartzParam.getParavalue());
        }
    }
    return params;
}

From source file:com.nesscomputing.config.ConfigDynamicMBean.java

private static Map<String, Object> toMap(Config config) {
    AbstractConfiguration configuration = config.getConfiguration();
    Iterator<String> keys = configuration.getKeys();

    Map<String, Object> result = Maps.newHashMap();
    while (keys.hasNext()) {
        String key = keys.next();
        result.put(key, configuration.getString(key));
    }//www. j a v a2s . co  m

    return result;
}

From source file:com.google.gdata.wireformats.GeneratorUtils.java

/**
 * Calculate the set of namespaces on an element.  This will find all
 * namespaces declared on the element or child elements, ordered in
 * depth-first order./* w ww.j av a  2 s.  c om*/
 */
public static Map<String, XmlNamespace> calculateNamespaces(Element root, ElementMetadata<?, ?> metadata) {
    Map<String, XmlNamespace> namespaceMap = Maps.newHashMap();
    calculateNamespaces(namespaceMap, root, metadata);
    return namespaceMap;
}