?? searchresult.java
字號:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.hadeslee.yoyoplayer.lyric;import com.hadeslee.yoyoplayer.util.Config;import java.io.BufferedWriter;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStreamWriter;/** * 搜索到的結果的對象表示法 * @author hadeslee */public class SearchResult { private String artist;//表示結果的歌手名 private String title;//表示結果的標題 private Task task;//下載歌詞的任務 private String content; public static interface Task { public String getLyricContent() throws IOException; } public SearchResult(String artist, String title, Task task) { this.artist = artist; this.title = title; this.task = task; } public String getArtist() { return artist; } public String getTitle() { return title; } public String getContent() { return content; } public void save(String name) throws IOException { content = task.getLyricContent(); BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(new File(Config.HOME, "Lyrics/" + name)))); bw.write(content); bw.close(); } public String toString() { return artist + ":" + title; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -