Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.savvasdalkitsis.jtmdb;
  
  import java.net.URL;
  import java.util.HashMap;
  import java.util.Map;
  
This class represents a Movie Poster.

Author(s):
Savvas Dalkitsis
 
 public class MoviePoster implements Serializable {
 
 	private static final long serialVersionUID = -484188331871936455L;

This enumeration provides different sizes for the posters.

Author(s):
Savvas Dalkitsis
 
 	public enum Size {
 		THUMB, W342, COVER, W154, MID, ORIGINAL
 	}

The urls and dimensions info for the different sizes of the poster.
 
 	private Map<SizePair<DimensionURL>> info = new HashMap<SizePair<DimensionURL>>();

The ID of the backdrop.
 
 	private String ID;

Constructs a new MoviePoster.

Parameters:
ID The ID of the poster.
 
 	public MoviePoster(String ID) {
 		this. = ID;
 		Log
 				.log("Creating MoviePoster object with id: " + ID,
 	}

Constructs a new MoviePoster.

Parameters:
info The url and dimension infos of the different sizes of the poster.
ID The ID of the poster.
 
 	public MoviePoster(Map<SizePair<DimensionURL>> infoString ID) {
 		this(ID);
 		if (info != null) {
 			this..putAll(info);
 		}
 	}

Returns the Url of the poster for the specified size if it exists, otherwise null.

Parameters:
size The size of the poster.
Returns:
The Url of the poster for the specified size if it exists, otherwise null.
 
 	public URL getImage(Size size) {
 		return .get(size).getSecond();
 	}

Returns the dimensions of the poster for the specified size if it exists, otherwise null.

Parameters:
size The size of the poster.
Returns:
The dimension of the poster for the specified size if it exists, otherwise null.
 
 	public Dimension getImageDimension(Size size) {
 		return .get(size).getFirst();
 	}

Sets the image Url and dimension for the provided size.

Parameters:
size The size of the poster.
info The Url and dimension info of the poster for the specified size.
	public void setImage(Size sizePair<DimensionURLinfo) {
		this..put(sizeinfo);
	}

The poster ID.

Returns:
The poster ID.
	public String getID() {
		return ;
	}

Returns the Url of the smallest available size.

Returns:
The Url of the smallest available size.
	public URL getSmallestImage() {
		if (url == null)
		if (url == null)
		if (url == null)
		if (url == null)
		if (url == null)
		return url;
	}

Returns the Url of the largest available size.

Returns:
The Url of the largest available size.
	public URL getLargestImage() {
		if (url == null)
		if (url == null)
		if (url == null)
		if (url == null)
		if (url == null)
		return url;
	}

Returns the dimensions of the smallest available size.

Returns:
The dimensions of the smallest available size.
		if (dim == null)
		if (dim == null)
		if (dim == null)
		if (dim == null)
		if (dim == null)
		return dim;
	}

Returns the dimensions of the largest available size.

Returns:
The dimensions of the largest available size.
		if (dim == null)
		if (dim == null)
		if (dim == null)
		if (dim == null)
		if (dim == null)
		return dim;
	}
New to GrepCode? Check out our FAQ X