FileDocCategorySizeDatePackage
CD.javaAPI DocExample4385Wed Sep 19 09:25:18 BST 2001javaxml2

CD

public class CD extends Object

CD is an object representation of a musical CD.

Fields Summary
private String
title
The title of this CD
private String
artist
The artist performing on the CD
private String
label
The label of the CD
Constructors Summary
public CD()

Default constructor.

        // Default constructor
    
public CD(String title, String artist, String label)

This creates a new CD with the supplied title, artist, and label.

param
title the title of the CD.
param
the CD's musical artist.
param
the label the CD is put out on.

        this.title = title;
        this.artist = artist;
        this.label = label;
    
Methods Summary
public java.lang.StringgetArtist()

This returns the musical artist for this CD.

return
String - the artist of this CD.

        return artist;
    
public java.lang.StringgetLabel()

This returns the label for this CD.

return
String - this CD's label.

        return label;
    
public java.lang.StringgetTitle()

This returns the title of this CD.

return
String - the title of the CD.

 
        return title;
    
public voidsetArtist(java.lang.String artist)

This will set the artist for this CD.

param
artist the artist for this CD.

        this.artist = artist;
    
public voidsetLabel(java.lang.String label)

This will set the label of this CD.

param
label the label for this CD.

        this.label = label;
    
public voidsetTitle(java.lang.String title)

This will set the title of this CD.

param
title the title for the CD.

        this.title = title;
    
public java.lang.StringtoString()

This overrides the default behavior of toString() and provides the basic information about this CD instance.

return
String - textual representation of this CD.

        return "'" + title + "' by " + artist + ", on " +
            label;