⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 artist.java

📁 eclise rcp 项目,是非常好的学习源码
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2007 Siemens AG
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Kai T鰀ter - initial API and implementation
 *******************************************************************************/
 
package com.siemens.ct.mp3m.model.logical;

import java.util.ArrayList;
import java.util.List;


 /**
 * This class represents an Artist
 */
public class Artist {
    List<Album> albums = new ArrayList<Album>();

    private String name;

    public Artist(String name) {
        this.name = name;
    }

    public List<Album> getAlbums() {
        return albums;
    }

    public Album addAlbum(String albumName) {
        for(Album album: albums) {
            if(albumName.equals(album.getName())) {
                return album;
            }
        }
        Album album = new Album(this, albumName);
        albums.add(album);
        return album;
    }

    /**
     * Gets the name.
     * 
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the name.
     * 
     * @param name
     *            The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -