Methods Summary |
---|
public boolean | equals(java.lang.Object oOther)Compare ContentTypes for equality by genre and refinement values.
if ((oOther == null) || (!(oOther instanceof ContentType)))
{
return false;
}
ContentType oOtherContentType = (ContentType)oOther;
if (!m_oGenreSet.equals(oOtherContentType.m_oGenreSet))
{
return false;
}
if ( ((m_sRefinement == null) && (oOtherContentType.m_sRefinement != null)) ||
((m_sRefinement != null) && (oOtherContentType.m_sRefinement == null)) ||
(!m_sRefinement.equals(oOtherContentType.m_sRefinement)) )
{
return false;
}
if (m_bIsRemix != oOtherContentType.m_bIsRemix)
{
return false;
}
if (m_bIsCover != oOtherContentType.m_bIsCover)
{
return false;
}
return true;
|
public org.blinkenlights.jid3.v2.ContentType$Genre[] | getGenres()Get all of the set genres in this content type.
return (Genre[])m_oGenreSet.toArray(new Genre[0]);
|
public java.lang.String | getRefinement()Get the current refinement, if set, for this content type.
return m_sRefinement;
|
public boolean | isCover()Check whether or not this content type describes a recording which is a cover.
return m_bIsCover;
|
public boolean | isRemix()Check whether or not this content type describes a recording which is a remix.
return m_bIsRemix;
|
public boolean | isSet(org.blinkenlights.jid3.v2.ContentType$Genre oGenre)Check whether a given genre is set.
return m_oGenreSet.contains(oGenre);
|
public boolean | setGenre(org.blinkenlights.jid3.v2.ContentType$Genre oGenre)Set a given genre for this recording. More than one genre can be set independently.
return m_oGenreSet.add(oGenre);
|
public void | setIsCover(boolean bIsCover)Toggle whether or not the recording described by this content type is a cover.
m_bIsCover = bIsCover;
|
public void | setIsRemix(boolean bIsRemix)Toggle whether or not the recording described by this content type is a remix.
m_bIsRemix = bIsRemix;
|
public void | setRefinement(java.lang.String sRefinement)Set a refinement for the genre of the recording repesented by this content type. Refinements are
free-form text, and can be used where no existing genre accurately describes the content.
m_sRefinement = sRefinement;
|
public java.lang.String | toString()Get the string representation of this content type.
// build text string
StringBuffer sbContentType = new StringBuffer();
// genre byte values in sequence, surrounded by brackets
ContentType.Genre[] aoGenre = getGenres();
for (int i=0; i < aoGenre.length; i++)
{
sbContentType.append("(" + aoGenre[i].getByteValue() + ")");
}
// cover code if specified
if (isCover())
{
sbContentType.append("(CR)");
}
// remix code if specified
if (isRemix())
{
sbContentType.append("(RX)");
}
// refinement comes last, if specified
if (getRefinement() != null)
{
String sRefinement = getRefinement();
// if refinement begins with opening bracket, we must double it as an escape sequence
if (sRefinement.startsWith("("))
{
sbContentType.append("(");
}
sbContentType.append(sRefinement);
}
return sbContentType.toString();
|
public boolean | unsetGenre(org.blinkenlights.jid3.v2.ContentType$Genre oGenre)Unset a given genre for this recording.
return m_oGenreSet.remove(oGenre);
|