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

📄 cds.java

📁 音像管理软件
💻 JAVA
字号:
package mediasystem.mediadata;

import java.util.*;
import mediasystem.media.*;

public class CDs {
  Vector CDList = new  Vector();

  public boolean isExisted(String ISRC){
    for(int i = 0; i < CDList.size(); i++){
      if(((MyCD)CDList.get(i)).getISRC().compareTo(ISRC) == 0) {
        return true;
      }
    }
    return false;
  }

  public void addCD(String[] newCDInfo) {
    MyCD newCD = new MyCD();
    newCD.setMediaName(newCDInfo[0]);
    newCD.setPrice(Float.parseFloat(newCDInfo[1]));
    newCD.setPress(newCDInfo[2]);
    newCD.setArtist(newCDInfo[3]);
    newCD.setISRC(newCDInfo[4]);
    CDList.add(newCD);
  }

  public LinkedList searchCD(String CDName ,String artist) {
    LinkedList list = new LinkedList();
    for (int i = 0; i < CDList.size(); i++) {
      MyCD index = (MyCD)CDList.get(i);
      boolean compareResult1 = (index.getMediaName().compareTo(CDName) == 0);
      if (CDName.compareTo("") == 0)
        compareResult1 = true;
      boolean compareResult2 = (index.getArtist().compareTo(artist) == 0);
      if (artist.compareTo("") == 0)
        compareResult2 = true;

      if (compareResult1 && compareResult2) {
        list.add(index);
      }
    }
    return list;
  }

  public boolean delCD(String ISRC) {
     for(int i = 0; i < CDList.size(); i++){
       MyCD index = (MyCD)CDList.get(i);
       if(index.getISRC().compareTo(ISRC) == 0){
         CDList.remove(i);
         return true;
       }
     }
     return false;
   }

}

⌨️ 快捷键说明

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