Rakesh API

org.rakeshv.xml.album
Class Album

java.lang.Object
  extended by org.rakeshv.xml.album.Album
All Implemented Interfaces:
java.io.Serializable

public class Album
extends java.lang.Object
implements java.io.Serializable

A Java bean that represents one photo album entry in the photo albums XML file.

© Copyright 2003 Rakesh Vidyadharan

Version:
$Id: Album.java,v 1.2 2004/05/26 11:42:40 rakesh Exp $
Author:
Rakesh Vidyadharan 2003 October 31
See Also:
Serialized Form

Field Summary
private  java.lang.String description
          The description element for the album.
private  java.lang.String name
          The name attribute for an album.
(package private)  java.util.Map photos
          A Map of Photo java bean instances that represent all the photo elements in the XML file.
 
Constructor Summary
private Album()
          Default constructor.
  Album(java.lang.String name)
          The only public constructor that is supported.
 
Method Summary
 void addPhoto(Photo photo)
          Add the specified Photo instance to the photos map.
 boolean equals(java.lang.Object object)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getDescription()
          Returns description.
 java.lang.String getName()
          Returns name.
 java.util.Map getPhotos()
          Returns photos.
 int hashCode()
          Returns a hash code value for the object.
 void setDescription(java.lang.String description)
          Set description.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The name attribute for an album.


photos

java.util.Map photos
A Map of Photo java bean instances that represent all the photo elements in the XML file.


description

private java.lang.String description
The description element for the album.

Constructor Detail

Album

private Album()
Default constructor. Just initialise the photos map. This method cannot be directly involved. New instances of this class should always be created with a proper name value.


Album

public Album(java.lang.String name)
The only public constructor that is supported. Set the value of the instance variable name to the specified value.

Parameters:
name - - The name value to use for this album.
Method Detail

addPhoto

public void addPhoto(Photo photo)
Add the specified Photo instance to the photos map.


equals

public boolean equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. Returns true if the specified object is an instance of Album, and the values of name are the same.

Overrides:
equals in class java.lang.Object
Parameters:
object - - The object that is to be compared with this instance.

hashCode

public int hashCode()
Returns a hash code value for the object. Returns the hash code associated with the name instance variable.

Overrides:
hashCode in class java.lang.Object
Returns:
int - The hash code value.

toString

public java.lang.String toString()
Returns a string representation of the object. Return the value of name.

Overrides:
toString in class java.lang.Object
Returns:
String - The string represenetation of this instance.

getPhotos

public final java.util.Map getPhotos()
Returns photos.

Returns:
Map - The value/reference of/to photos.

getDescription

public final java.lang.String getDescription()
Returns description.

Returns:
String - The value/reference of/to description.

setDescription

public final void setDescription(java.lang.String description)
Set description.

Parameters:
description - - The value to set.

getName

public final java.lang.String getName()
Returns name.

Returns:
String - The value/reference of/to name.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan