Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitIPLSID3V2Frame(this);
|
public void | addInvolvedPerson(org.blinkenlights.jid3.v2.IPLSID3V2Frame$InvolvedPerson oInvolvedPerson)Add an involved person to the list.
// create set mapping if not there
if ( ! m_oPeopleMap.containsKey(oInvolvedPerson.getInvolvement()))
{
m_oPeopleMap.put(oInvolvedPerson.getInvolvement(), new TreeSet());
}
// add involved person to mapped set
Set oIPSet = (Set)m_oPeopleMap.get(oInvolvedPerson.getInvolvement());
oIPSet.add(oInvolvedPerson);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof IPLSID3V2Frame)))
{
return false;
}
IPLSID3V2Frame oOtherIPLS = (IPLSID3V2Frame)oOther;
return ( m_oTextEncoding.equals(oOtherIPLS.m_oTextEncoding) &&
m_oPeopleMap.equals(oOtherIPLS.m_oPeopleMap));
|
protected byte[] | getFrameId()
return "IPLS".getBytes();
|
public org.blinkenlights.jid3.v2.IPLSID3V2Frame$InvolvedPerson[] | getInvolvedPersons(java.lang.String sInvolvement)Get all involved persons with a given involvement.
Set oIPSet = (Set)m_oPeopleMap.get(sInvolvement);
if (oIPSet != null)
{
return (InvolvedPerson[])oIPSet.toArray(new InvolvedPerson[0]);
}
else
{
return new InvolvedPerson[0];
}
|
public TextEncoding | getTextEncoding()Get the text encoding used for the involved people in this frame.
return m_oTextEncoding;
|
public org.blinkenlights.jid3.v2.IPLSID3V2Frame$InvolvedPerson[] | removedInvolvedPersons(java.lang.String sInvolvement)Removed all persons with a given involvement.
Set oIPSet = (Set)m_oPeopleMap.remove(sInvolvement);
if (oIPSet != null)
{
return (InvolvedPerson[])oIPSet.toArray(new InvolvedPerson[0]);
}
else
{
return new InvolvedPerson[0];
}
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the involved people in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
StringBuffer sbOutput = new StringBuffer();
sbOutput.append("InvolvedPersons: Involvments =");
if (m_oPeopleMap.values().size() > 0)
{
Iterator oSetIter = m_oPeopleMap.values().iterator();
while (oSetIter.hasNext())
{
Set oInvolvedPersonSet = (Set)oSetIter.next();
Iterator oIPIter = oInvolvedPersonSet.iterator();
while (oIPIter.hasNext())
{
InvolvedPerson oIP = (InvolvedPerson)oIPIter.next();
sbOutput.append("\nInvolvement=" + oIP.getInvolvement() + ", Person=" + oIP.getPerson());
}
}
}
else
{
sbOutput.append(" none");
}
return sbOutput.toString();
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// text encoding
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
// involvements
Iterator oSetIter = m_oPeopleMap.values().iterator();
while (oSetIter.hasNext())
{
Set oInvolvedPersonSet = (Set)oSetIter.next();
Iterator oIPIter = oInvolvedPersonSet.iterator();
while (oIPIter.hasNext())
{
InvolvedPerson oIP = (InvolvedPerson)oIPIter.next();
oIDOS.write(oIP.getInvolvement().getBytes(m_oTextEncoding.getEncodingString()));
// null after involvement
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
oIDOS.write(oIP.getPerson().getBytes(m_oTextEncoding.getEncodingString()));
// null after person
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
}
}
|