|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.commons.TagFormatter
public final class TagFormatter
Formats tags to a string. The following tags are supported:
the title
album name
the artist
the genre
bitrate
in kbps
(without the "kbps" string)year
length
in the h:mm:ss
formattrack number
If you surround a portion of text that contains a token (or a group) with curly braces, that section will be hidden if all contained tokens and/or groups are empty.
This object is not thread-safe.
Field Summary | |
---|---|
String |
formatString
The format string. |
Constructor Summary | |
---|---|
TagFormatter(String formatString)
Creates new formatter and compiles the format string. |
Method Summary | |
---|---|
void |
format(StringBuilder builder,
TrackMetadataBean bean,
boolean collapse)
Formats given track and appends it into given string builder. |
String |
format(TrackMetadataBean bean)
Formats given track. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final String formatString
Constructor Detail |
---|
public TagFormatter(String formatString) throws ParseException
formatString
- the string
ParseException
- if we failed to parse the format string.Method Detail |
---|
public void format(StringBuilder builder, TrackMetadataBean bean, boolean collapse)
builder
- the builder to append the formatted track to.bean
- the track to formatcollapse
- if true
then the formatter will collapse when
all tags/groups are empty.public String format(TrackMetadataBean bean)
bean
- the track to format
null
formatted string.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |