Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitOWNEID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof OWNEID3V2Frame)))
{
return false;
}
OWNEID3V2Frame oOtherOWNE = (OWNEID3V2Frame)oOther;
return (m_oTextEncoding.equals(oOtherOWNE.m_oTextEncoding) &&
m_sPricePaid.equals(oOtherOWNE.m_sPricePaid) &&
m_sDateOfPurchase.equals(oOtherOWNE.m_sDateOfPurchase) &&
m_sSeller.equals(oOtherOWNE.m_sSeller));
|
public java.lang.String | getDateOfPurchase()Get the date of purchase.
return m_sDateOfPurchase;
|
protected byte[] | getFrameId()
return "OWNE".getBytes();
|
public java.lang.String | getPricePaid()Get price paid.
return m_sPricePaid;
|
public java.lang.String | getSeller()Get the name of the seller.
return m_sSeller;
|
public TextEncoding | getTextEncoding()Get the text encoding used for the seller in this frame.
return m_oTextEncoding;
|
public void | setOwnershipInformation(java.lang.String sPricePaid, java.lang.String sDateOfPurchase, java.lang.String sSeller)Set ownership information.
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
if (sPricePaid == null)
{
throw new ID3Exception("Price paid required in OWNE frame.");
}
if ( ! sPricePaid.matches("(?uis)(\\w{3}\\d*\\.?\\d+/?)+"))
{
throw new ID3Exception("Invalid OWNE frame price paid string.");
}
m_sPricePaid = sPricePaid;
if (sDateOfPurchase == null)
{
throw new ID3Exception("Date of purchase required in OWNE frame.");
}
if ( ! sDateOfPurchase.matches("(?uis)\\d{8}"))
{
throw new ID3Exception("Invalid OWNE frame date of purchase.");
}
m_sDateOfPurchase = sDateOfPurchase;
if (sSeller == null)
{
throw new ID3Exception("Seller required in OWNE frame.");
}
m_sSeller = sSeller;
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the seller in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
return "Ownership Frame: Price paid=[" + m_sPricePaid + "], Date of purchase=[" + m_sDateOfPurchase +
"], Seller=[" + m_sSeller + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// text encoding
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
// price paid string
oIDOS.write(m_sPricePaid.getBytes());
oIDOS.writeUnsignedByte(0);
// date of purchase until
oIDOS.write(m_sDateOfPurchase.getBytes());
// seller
oIDOS.write(m_sSeller.getBytes(m_oTextEncoding.getEncodingString()));
|