Constructors Summary |
---|
public FrameBodyIPLS()Creates a new FrameBodyIPLS datatype.
super();
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
|
public FrameBodyIPLS(ByteBuffer byteBuffer, int frameSize)
super(byteBuffer, frameSize);
|
public FrameBodyIPLS(FrameBodyIPLS body)
super(body);
|
public FrameBodyIPLS(byte textEncoding, String text)Creates a new FrameBodyIPLS data type.
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
setText(text);
|
public FrameBodyIPLS(FrameBodyTIPL body)Convert from V4 to V3 Frame
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, body.getTextEncoding());
setText(body.getText());
|
Methods Summary |
---|
public void | addPair(java.lang.String text)
PairedTextEncodedStringNullTerminated.ValuePairs value = ((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).getValue();
StringTokenizer stz = new StringTokenizer(text, "\0");
if (stz.hasMoreTokens())
{
value.add(stz.nextToken(),stz.nextToken());
}
|
public java.lang.String | getIdentifier()The ID3v23 frame identifier
return ID3v23Frames.FRAME_ID_V3_IPLS;
|
public java.lang.String | getKeyAtIndex(int index)Get key at index
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return text.getValue().getMapping().get(index).getKey();
|
public int | getNumberOfPairs()
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return text.getValue().getNumberOfPairs();
|
public PairedTextEncodedStringNullTerminated.ValuePairs | getPairing()
return (PairedTextEncodedStringNullTerminated.ValuePairs)getObject(DataTypes.OBJ_TEXT).getValue();
|
public java.lang.String | getText()
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
StringBuilder sb = new StringBuilder();
int count=1;
for(Pair entry:text.getValue().getMapping())
{
sb.append(entry.getKey()+'\0"+entry.getValue());
if(count!=getNumberOfPairs())
{
sb.append('\0");
}
count++;
}
return sb.toString();
|
public java.lang.String | getUserFriendlyValue()
return getText();
|
public java.lang.String | getValueAtIndex(int index)Get value at index
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return text.getValue().getMapping().get(index).getValue();
|
public void | setText(java.lang.String text)Set the text, decoded as pairs of involvee - involvement
PairedTextEncodedStringNullTerminated.ValuePairs value = new PairedTextEncodedStringNullTerminated.ValuePairs();
StringTokenizer stz = new StringTokenizer(text, "\0");
while (stz.hasMoreTokens())
{
String key =stz.nextToken();
if(stz.hasMoreTokens())
{
value.add(key, stz.nextToken());
}
}
setObjectValue(DataTypes.OBJ_TEXT, value);
|
protected void | setupObjectList()Consists of a text encoding , and then a series of null terminated Strings, there should be an even number
of Strings as they are paired as involvement/involvee
objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
objectList.add(new PairedTextEncodedStringNullTerminated(DataTypes.OBJ_TEXT, this));
|
public void | write(java.io.ByteArrayOutputStream tagBuffer)Because have a text encoding we need to check the data values do not contain characters that cannot be encoded in
current encoding before we write data. If they do change the encoding.
if (!((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).canBeEncoded())
{
this.setTextEncoding(TextEncoding.UTF_16);
}
super.write(tagBuffer);
|