Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 *  2014 Brien Coffield
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 */

import java.net.URL;

import java.util.Map;

public class Main {
    public static URL getLargestImageURL(Map<String, URL> imageURLs) {
        if (imageURLs == null) {
            return null;
        }

        URL result = imageURLs.get("large");

        if (result != null) {
            return result;
        }

        result = imageURLs.get("medium");

        if (result != null) {
            return result;
        }

        return imageURLs.get("small");
    }
}