Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.savvasdalkitsis.jtmdb;
  
  import java.net.URL;
  
  
  import  org.json.JSONException;
  import  org.json.JSONObject;
  
This class represents an entry in the cast list of a Movie. It contains info about a member of cast and its ID is the same ID with that of the Person in the cast.

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

The Url of the cast.
 
 	private URL url;
The name of the cast.
 
 	private String name;
The name of the character of the cast.
 
 	private String characterName;
The job description of the cast.
 
 	private String job;
The ID of the person.
 
 	private int ID;
The ID of the cast.
 
 	private int castID;
The thumbnail Url of the cast.
 
 	private URL thumb;
The department of the job of the cast.
 
 	private String department;
The json string that created this CastInfo object.
 
 	private String jsonOrigin;

Constructs a new CastInfo object.

Parameters:
url The Url of the cast.
name The name of the cast.
characterName The name of the character of the cast.
job The job description of the cast.
ID The ID of the person.
castID The ID of the cast.
thumb The thumbnail Url of the cast.
department The department of the job of the cast.
jsonOrigin The json string that created this CastInfo object.
 
 	public CastInfo(URL urlString nameString characterNameString job,
 			int IDint castIDURL thumbString departmentString jsonOrigin) {
 		Log.log("Creating CastInfo object with url: "
 				+ ((url == null) ? "NULL" : url.toString())
 				+ ",character name: " + characterName + ", job: " + job
 				+ "id: " + ID + ", castID: +" + castID + ", thumb URL: "
 				+ ((thumb == null) ? "NULL" : thumb.toString())
 				+ ", department: " + department + " and name: " + name,
 		this. = jsonOrigin;
 		setUrl(url);
 		setName(name);
 		setCharacterName(characterName);
 		setJob(job);
 		setID(ID);
 		setCastID(castID);
 		setThumb(thumb);
 		setDepartment(department);
	}
	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (obj instanceof CastInfo) {
			if (((CastInfoobj).getCastID() == getCastID()
					&& ((CastInfoobj).getID() == getID()) {
				return true;
			}
		}
		return false;
	}
	public int hashCode() {
		// We will use the algorithm used in the hash code
		// calculation for the Point2D class;
		int x = getID();
		int y = getCastID();
		long bits = java.lang.Double.doubleToLongBits(x);
		bits ^= java.lang.Double.doubleToLongBits(y) * 31;
		return (((intbits) ^ ((int) (bits >> 32)));
	}

The json string that created this CastInfo object.

Returns:
The json string that created this CastInfo object.
	public String getJsonOrigin() {
		return ;
	}

The prettyprinted json string that created this CastInfo object.

Parameters:
indentFactor The number of spaces to add to each level of indentation.
Returns:
The json string that created this CastInfo object.
	public String getJsonOrigin(int indentFactor) {
		try {
			return new JSONObject().toString(indentFactor);
catch (JSONException e) {
			return null;
		}
	}

The Url of the cast.

Returns:
The Url of the cast.
	public URL getUrl() {
		return ;
	}

Sets the Url of the cast.

Parameters:
url The Url of the cast.
	public void setUrl(URL url) {
		this. = url;
	}

The name of the cast.

Returns:
The name of the cast.
	public String getName() {
		return ;
	}

Sets the name of the cast.

Parameters:
name The name of the cast.
	public void setName(String name) {
		this. = name;
	}

The name of the character of the cast.

Returns:
The name of the character of the cast.
	}

Sets the name of the character of the cast.

Parameters:
characterName The name of the character of the cast.
	public void setCharacterName(String characterName) {
		this. = characterName;
	}

The job description of the cast.

Returns:
The job description of the cast.
	public String getJob() {
		return ;
	}

Sets the job description of the cast.

Parameters:
job The job description of the cast.
	public void setJob(String job) {
		this. = job;
	}

The ID of the person.

Returns:
The ID of the person.
	public int getID() {
		return ;
	}

Sets the ID of the person.

Parameters:
iD The ID of the person.
	public void setID(int iD) {
		 = iD;
	}

The ID of the cast.

Returns:
The ID of the cast.
	public int getCastID() {
		return ;
	}

Sets the ID of the cast.

Parameters:
castID The ID of the cast.
	public void setCastID(int castID) {
		this. = castID;
	}

The thumbnail Url of the cast.

Returns:
The thumbnail Url of the cast.
	public URL getThumb() {
		return ;
	}

Sets the thumbnail Url of the cast.

Parameters:
thumb The thumbnail Url of the cast.
	public void setThumb(URL thumb) {
		this. = thumb;
	}

Sets the department of the job of the cast.

Parameters:
department The department of the job of the cast.
	public void setDepartment(String department) {
		this. = department;
	}

The department of the job of the cast.

Returns:
The department of the job of the cast.
	public String getDepartment() {
		return ;
	}
New to GrepCode? Check out our FAQ X