Example usage for java.util AbstractMap keySet

List of usage examples for java.util AbstractMap keySet

Introduction

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

Prototype

Set keySet

To view the source code for java.util AbstractMap keySet.

Click Source Link

Document

Each of these fields are initialized to contain an instance of the appropriate view the first time this view is requested.

Usage

From source file:MainClass.java

public static void main(String args[]) {
    AbstractMap map = new ArrayMap(13);
    map.put("Virginia", "Richmond");
    map.put("Massachusetts", "Boston");
    map.put("New York", "Albany");
    System.out.println(map);//from  w  w  w  .  j av a  2 s .c om
    System.out.println(map.keySet());
    System.out.println(map.values());
}

From source file:com.mellanox.r4h.DFSInputStream.java

private static String getBestNodeDNAddrPairErrorString(DatanodeInfo nodes[],
        AbstractMap<DatanodeInfo, DatanodeInfo> deadNodes, Collection<DatanodeInfo> ignoredNodes) {
    StringBuilder errMsgr = new StringBuilder(" No live nodes contain current block ");
    errMsgr.append("Block locations:");
    for (DatanodeInfo datanode : nodes) {
        errMsgr.append(" ");
        errMsgr.append(datanode.toString());
    }/* w ww.j a  va 2s  .c om*/
    errMsgr.append(" Dead nodes: ");
    for (DatanodeInfo datanode : deadNodes.keySet()) {
        errMsgr.append(" ");
        errMsgr.append(datanode.toString());
    }
    if (ignoredNodes != null) {
        errMsgr.append(" Ignored nodes: ");
        for (DatanodeInfo datanode : ignoredNodes) {
            errMsgr.append(" ");
            errMsgr.append(datanode.toString());
        }
    }
    return errMsgr.toString();
}