EMMA Coverage Report (generated Tue Mar 14 21:50:42 EST 2006)
[all classes][org.farng.mp3.id3]

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyGRID.java]

nameclass, %method, %block, %line, %
FrameBodyGRID.java0%   (0/1)0%   (0/10)0%   (0/96)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyGRID0%   (0/1)0%   (0/10)0%   (0/96)0%   (0/25)
FrameBodyGRID (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyGRID (FrameBodyGRID): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyGRID (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyGRID (String, byte, byte []): void 0%   (0/1)0%   (0/18)0%   (0/5)
getGroupSymbol (): byte 0%   (0/1)0%   (0/12)0%   (0/3)
getIdentifier (): String 0%   (0/1)0%   (0/15)0%   (0/1)
getOwner (): String 0%   (0/1)0%   (0/5)0%   (0/1)
setGroupSymbol (byte): void 0%   (0/1)0%   (0/8)0%   (0/2)
setOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/20)0%   (0/4)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectByteArraySizeTerminated;
5import org.farng.mp3.object.ObjectNumberFixedLength;
6import org.farng.mp3.object.ObjectStringNullTerminated;
7 
8import java.io.IOException;
9import java.io.RandomAccessFile;
10 
11/**
12 * <h3>4.26.&nbsp;&nbsp; Group identification registration</h3>
13 * <p/>
14 * <p>&nbsp;&nbsp; This frame enables grouping of otherwise unrelated frames. This can<br>
15 * <p/>
16 * &nbsp;&nbsp; be used when some frames are to be signed. To identify which frames<br> &nbsp;&nbsp; belongs to a set of
17 * frames a group identifier must be registered in<br> &nbsp;&nbsp; the tag with this frame. The 'Owner identifier' is a
18 * null-terminated<br> &nbsp;&nbsp; string with a URL [URL] containing an email address, or a link to a<br> &nbsp;&nbsp;
19 * location where an email address can be found, that belongs to the<br>
20 * <p/>
21 * &nbsp;&nbsp; organisation responsible for this grouping. Questions regarding the<br> &nbsp;&nbsp; grouping should be
22 * sent to the indicated email address. The 'Group<br> &nbsp;&nbsp; symbol' contains a value that associates the frame
23 * with this group<br> &nbsp;&nbsp; throughout the whole tag, in the range $80-F0. All other values are<br> &nbsp;&nbsp;
24 * reserved. The 'Group symbol' may optionally be followed by some group<br>
25 * <p/>
26 * &nbsp;&nbsp; specific data, e.g. a digital signature. There may be several &quot;GRID&quot;<br> &nbsp;&nbsp; frames
27 * in a tag but only one containing the same symbol and only one<br> &nbsp;&nbsp; containing the same owner identifier.
28 * The group symbol must be used<br> &nbsp;&nbsp; somewhere in the tag. See the description of the frame grouping
29 * flag<br>
30 * <p/>
31 * &nbsp;&nbsp; in the ID3v2 structure document [ID3v2-strct] for more information.</p>
32 * <p/>
33 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header for 'Group ID registration', ID: &quot;GRID&quot;&gt;<br>
34 * &nbsp;&nbsp;&nbsp;&nbsp; Owner identifier&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string&gt; $00<br>
35 * <p/>
36 * &nbsp;&nbsp;&nbsp;&nbsp; Group symbol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx<br>
37 * &nbsp;&nbsp;&nbsp;&nbsp; Group dependent data&nbsp; &lt;binary data&gt;<br> </p>
38 *
39 * @author Eric Farng
40 * @version $Revision: 1.4 $
41 */
42public class FrameBodyGRID extends AbstractID3v2FrameBody {
43 
44    /**
45     * Creates a new FrameBodyGRID object.
46     */
47    public FrameBodyGRID() {
48        super();
49    }
50 
51    /**
52     * Creates a new FrameBodyGRID object.
53     */
54    public FrameBodyGRID(final FrameBodyGRID body) {
55        super(body);
56    }
57 
58    /**
59     * Creates a new FrameBodyGRID object.
60     */
61    public FrameBodyGRID(final String owner, final byte groupSymbol, final byte[] data) {
62        setObject("Owner", owner);
63        setObject("Group Symbol", new Byte(groupSymbol));
64        setObject("Group Dependent Data", data);
65    }
66 
67    /**
68     * Creates a new FrameBodyGRID object.
69     */
70    public FrameBodyGRID(final RandomAccessFile file) throws IOException, InvalidTagException {
71        this.read(file);
72    }
73 
74    public void setGroupSymbol(final byte textEncoding) {
75        setObject("Group Symbol", new Byte(textEncoding));
76    }
77 
78    public byte getGroupSymbol() {
79        if (getObject("Group Symbol") != null) {
80            return ((Byte) getObject("Group Symbol")).byteValue();
81        }
82        return 0;
83    }
84 
85    public String getIdentifier() {
86        return "GRID" + ((char) 0) + getOwner() + ((char) 0) + getGroupSymbol();
87    }
88 
89    public void setOwner(final String owner) {
90        setObject("Owner", owner);
91    }
92 
93    public String getOwner() {
94        return (String) getObject("Owner");
95    }
96 
97    protected void setupObjectList() {
98        appendToObjectList(new ObjectStringNullTerminated("Owner"));
99        appendToObjectList(new ObjectNumberFixedLength("Group Symbol", 1));
100        appendToObjectList(new ObjectByteArraySizeTerminated("Group Dependent Data"));
101    }
102}

[all classes][org.farng.mp3.id3]
EMMA 2.0.5312 (C) Vladimir Roubtsov