import java.util.*; import java.io.*; public class AlbumEntry extends Entry implements Comparable { protected String name; protected ArtistEntry artist; protected Vector songs; protected int songcount; public AlbumEntry(String n) { name=n; songs=new Vector(); artist=null; songcount=0; } protected class SongSorter implements Comparator { public int compare(Object o1, Object o2) { SongEntry s1=(SongEntry)o1; SongEntry s2=(SongEntry)o2; int track1=s1.getTrack(),track2=s2.getTrack(); if(track1>track2) return 1; else if(track1")) { artist.removeAlbum(this); artist=TagDatabase.getInstance().getArtistEntry(""); } else artist=a; } public ArtistEntry getArtist() { return artist; } public int compareTo(Object o) { return String.CASE_INSENSITIVE_ORDER.compare(name,((AlbumEntry)o).getName()); } public String getName() { return name; } public Collection getSongs() { return songs; } public void write(DataOutputStream w) throws IOException { int x; w.writeBytes(name); for(x=TagDatabase.getInstance().albumlen-name.length();x>0;x--) w.write(0); w.writeInt(artist.getOffset()); Iterator i2 = songs.iterator(); x=0; while(i2.hasNext()) { Entry e = (Entry) i2.next(); w.writeInt(e.getOffset()); x++; } for(;x