4 public class ArtistEntry
extends Entry
implements Comparable
{
6 protected Vector albums
;
7 protected int albumcount
;
9 public ArtistEntry(String n
) {
15 public void addAlbum(AlbumEntry e
) {
16 if(!albums
.contains(e
)) {
20 Collections
.sort(albums
);
24 public void removeAlbum(AlbumEntry e
) {
29 public int size() { return albumcount
; }
31 public int compareTo(Object o
) {
32 return String
.CASE_INSENSITIVE_ORDER
.compare(name
,((ArtistEntry
)o
).getName());
35 public String
getName() { return name
; }
36 public Collection
getAlbums() { return albums
; }
37 public void write(DataOutputStream w
) throws IOException
{
40 for(x
=TagDatabase
.getInstance().artistlen
-name
.length();x
>0;x
--)
42 Iterator i2
= albums
.iterator();
45 Entry e
= (Entry
) i2
.next();
46 w
.writeInt(e
.getOffset());
49 for(;x
<TagDatabase
.getInstance().albumarraylen
;x
++)
52 public static int entrySize() {
53 TagDatabase td
=TagDatabase
.getInstance();
54 return td
.artistlen
+4*td
.albumarraylen
;