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

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyCOMR.java]

nameclass, %method, %block, %line, %
FrameBodyCOMR.java0%   (0/1)0%   (0/8)0%   (0/148)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyCOMR0%   (0/1)0%   (0/8)0%   (0/148)0%   (0/36)
FrameBodyCOMR (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyCOMR (FrameBodyCOMR): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyCOMR (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyCOMR (byte, String, String, String, byte, String, String, String, by... 0%   (0/1)0%   (0/45)0%   (0/11)
getIdentifier (): String 0%   (0/1)0%   (0/23)0%   (0/5)
getOwner (): String 0%   (0/1)0%   (0/5)0%   (0/1)
getOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/57)0%   (0/10)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectByteArraySizeTerminated;
5import org.farng.mp3.object.ObjectNumberHashMap;
6import org.farng.mp3.object.ObjectStringDate;
7import org.farng.mp3.object.ObjectStringNullTerminated;
8 
9import java.io.IOException;
10import java.io.RandomAccessFile;
11 
12/**
13 * <h3>4.24.&nbsp;&nbsp; Commercial frame</h3>
14 * <p/>
15 * <p>&nbsp;&nbsp; This frame enables several competing offers in the same tag by<br>
16 * <p/>
17 * &nbsp;&nbsp; bundling all needed information. That makes this frame rather complex<br> &nbsp;&nbsp; but it's an
18 * easier solution than if one tries to achieve the same<br> &nbsp;&nbsp; result with several frames. The frame begins,
19 * after the frame ID,<br> &nbsp;&nbsp; size and encoding fields, with a price string field. A price is<br> &nbsp;&nbsp;
20 * constructed by one three character currency code, encoded according<br>
21 * <p/>
22 * &nbsp;&nbsp; to ISO 4217 [ISO-4217] alphabetic currency code, followed by a<br> &nbsp;&nbsp; numerical value where
23 * &quot;.&quot; is used as decimal separator. In the price<br> &nbsp;&nbsp; string several prices may be concatenated,
24 * separated by a &quot;/&quot;<br> &nbsp;&nbsp; character, but there may only be one currency of each type.</p>
25 * <p/>
26 * <p>&nbsp;&nbsp; The price string is followed by an 8 character date string in the<br> &nbsp;&nbsp; format YYYYMMDD,
27 * describing for how long the price is valid. After<br> &nbsp;&nbsp; that is a contact URL, with which the user can
28 * contact the seller,<br> &nbsp;&nbsp; followed by a one byte 'received as' field. It describes how the<br>
29 * &nbsp;&nbsp; audio is delivered when bought according to the following list:</p>
30 * <p/>
31 * <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $00&nbsp; Other<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
32 * $01&nbsp; Standard CD album with other songs<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $02&nbsp; Compressed
33 * audio on CD<br>
34 * <p/>
35 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $03&nbsp; File over the Internet<br>
36 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $04&nbsp; Stream over the Internet<br>
37 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $05&nbsp; As note sheets<br>
38 * <p/>
39 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $06&nbsp; As note sheets in a book with other sheets<br>
40 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $07&nbsp; Music on other media<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
41 * $08&nbsp; Non-musical merchandise</p>
42 * <p/>
43 * <p>&nbsp;&nbsp; Next follows a terminated string with the name of the seller followed<br> &nbsp;&nbsp; by a
44 * terminated string with a short description of the product. The<br> &nbsp;&nbsp; last thing is the ability to include
45 * a company logotype. The first of<br> &nbsp;&nbsp; them is the 'Picture MIME type' field containing information
46 * about<br> &nbsp;&nbsp; which picture format is used. In the event that the MIME media type<br>
47 * <p/>
48 * &nbsp;&nbsp; name is omitted, &quot;image/&quot; will be implied. Currently only &quot;image/png&quot;<br>
49 * &nbsp;&nbsp; and &quot;image/jpeg&quot; are allowed. This format string is followed by the<br> &nbsp;&nbsp; binary
50 * picture data. This two last fields may be omitted if no<br>
51 * <p/>
52 * &nbsp;&nbsp; picture is attached. There may be more than one 'commercial frame' in<br> &nbsp;&nbsp; a tag, but no two
53 * may be identical.</p>
54 * <p/>
55 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header for 'Commercial frame', ID: &quot;COMR&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;
56 * Text encoding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx<br>
57 * <p/>
58 * &nbsp;&nbsp;&nbsp;&nbsp; Price string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string&gt; $00<br>
59 * &nbsp;&nbsp;&nbsp;&nbsp; Valid until&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string&gt;<br>
60 * &nbsp;&nbsp;&nbsp;&nbsp; Contact URL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
61 * <p/>
62 * &lt;text string&gt; $00<br> &nbsp;&nbsp;&nbsp;&nbsp; Received as&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx<br>
63 * &nbsp;&nbsp;&nbsp;&nbsp; Name of seller&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string according to encoding&gt; $00
64 * (00)<br>
65 * <p/>
66 * &nbsp;&nbsp;&nbsp;&nbsp; Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string according to
67 * encoding&gt; $00 (00)<br> &nbsp;&nbsp;&nbsp;&nbsp; Picture MIME type&nbsp; &lt;string&gt; $00<br>
68 * <p/>
69 * &nbsp;&nbsp;&nbsp;&nbsp; Seller logo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;binary data&gt;<br> </p>
70 *
71 * @author Eric Farng
72 * @version $Revision: 1.4 $
73 */
74public class FrameBodyCOMR extends AbstractID3v2FrameBody {
75 
76    /**
77     * Creates a new FrameBodyCOMR object.
78     */
79    public FrameBodyCOMR() {
80        super();
81    }
82 
83    /**
84     * Creates a new FrameBodyCOMR object.
85     */
86    public FrameBodyCOMR(final FrameBodyCOMR body) {
87        super(body);
88    }
89 
90    /**
91     * Creates a new FrameBodyCOMR object.
92     */
93    public FrameBodyCOMR(final byte textEncoding,
94                         final String priceString,
95                         final String validUntil,
96                         final String contactUrl,
97                         final byte recievedAs,
98                         final String nameOfSeller,
99                         final String description,
100                         final String mimeType,
101                         final byte[] sellerLogo) {
102        setObject("Text Encoding", new Byte(textEncoding));
103        setObject("Price String", priceString);
104        setObject("Valid Until", validUntil);
105        setObject("Contact URL", contactUrl);
106        setObject("Recieved As", new Byte(recievedAs));
107        setObject("Name Of Seller", nameOfSeller);
108        setObject("Description", description);
109        setObject("Picture MIME Type", mimeType);
110        setObject("Seller Logo", sellerLogo);
111    }
112 
113    /**
114     * Creates a new FrameBodyCOMR object.
115     */
116    public FrameBodyCOMR(final RandomAccessFile file) throws IOException, InvalidTagException {
117        this.read(file);
118    }
119 
120    public String getIdentifier() {
121        String str = "COMR";
122        final java.util.Iterator iterator = getObjectListIterator();
123        while (iterator.hasNext()) {
124            str += (((char) 0) + getOwner());
125        }
126        return str;
127    }
128 
129    public String getOwner() {
130        return (String) getObject("Owner");
131    }
132 
133    public void getOwner(final String description) {
134        setObject("Owner", description);
135    }
136 
137    protected void setupObjectList() {
138        appendToObjectList(new ObjectNumberHashMap(ObjectNumberHashMap.TEXT_ENCODING, 1));
139        appendToObjectList(new ObjectStringNullTerminated("Price String"));
140        appendToObjectList(new ObjectStringDate("Valid Until"));
141        appendToObjectList(new ObjectStringNullTerminated("Contact URL"));
142        appendToObjectList(new ObjectNumberHashMap(ObjectNumberHashMap.RECIEVED_AS, 1));
143        appendToObjectList(new ObjectStringNullTerminated("Name Of Seller"));
144        appendToObjectList(new ObjectStringNullTerminated("Description"));
145        appendToObjectList(new ObjectStringNullTerminated("Picture MIME Type"));
146        appendToObjectList(new ObjectByteArraySizeTerminated("Seller Logo"));
147    }
148}

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