1 19 20 package org.netbeans.core.registry.instanceconv; 21 22 import org.openide.filesystems.FileObject; 23 24 28 public class CD { 29 30 String artist; 31 String album; 32 33 public CD() { 34 artist = "TBD"; 35 album = "UNKNOWN"; 36 } 37 38 public CD(String ar, String al) { 39 artist = ar; 40 album = al; 41 } 42 43 static public CD createDefault() { 44 return new CD("V.A.", "Radio 1 Essential Mixes"); 45 } 46 47 static public CD createParam(FileObject fo) { 48 return new CD((String )fo.getAttribute("artist"), (String )fo.getAttribute("album")); 49 } 50 51 public boolean equals(Object o) { 52 if (!(o instanceof CD)) { 53 return false; 54 } 55 CD d = (CD)o; 56 return artist.equals(d.artist) && 57 album.equals(d.album); 58 } 59 60 public int hashCode() { 61 return 125; 63 } 64 65 public String toString() { 66 return "CD[artist="+artist+", album="+album+"]"+super.toString(); 67 } 68 69 } 70 | Popular Tags |