org.jaudiotagger.tag.datatype
Class PairedTextEncodedStringNullTerminated

java.lang.Object
  extended by org.jaudiotagger.tag.datatype.AbstractDataType
      extended by org.jaudiotagger.tag.datatype.PairedTextEncodedStringNullTerminated

public class PairedTextEncodedStringNullTerminated
extends AbstractDataType

Represents a data type that allow multiple Strings but they should be paired as key values, i.e should be 2,4,6.. But keys are not unique so we don't store as a map, so could have same key pointing to two different values such as two ENGINEER keys


Nested Class Summary
static class PairedTextEncodedStringNullTerminated.ValuePairs
          This holds the values held by this PairedTextEncodedDataType, always held as pairs of values
 
Field Summary
 
Fields inherited from class org.jaudiotagger.tag.datatype.AbstractDataType
frameBody, identifier, logger, size, TYPE_ELEMENT, value
 
Constructor Summary
PairedTextEncodedStringNullTerminated(PairedTextEncodedStringNullTerminated object)
           
PairedTextEncodedStringNullTerminated(java.lang.String identifier, AbstractTagFrameBody frameBody)
           
PairedTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object)
           
 
Method Summary
 boolean canBeEncoded()
          Check the value can be encoded with the specified encoding
 boolean equals(java.lang.Object obj)
           
 int getSize()
          Returns the size in bytes of this dataType when written to file
 PairedTextEncodedStringNullTerminated.ValuePairs getValue()
          Get value held by this Object
 void readByteArray(byte[] arr, int offset)
          Read Null Terminated Strings from the array starting at offset, continue until unable to find any null terminated Strings or until reached the end of the array.
 byte[] writeByteArray()
          For every String write to byteBuffer
 
Methods inherited from class org.jaudiotagger.tag.datatype.AbstractDataType
createStructure, getBody, getIdentifier, readByteArray, setBody, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairedTextEncodedStringNullTerminated

public PairedTextEncodedStringNullTerminated(java.lang.String identifier,
                                             AbstractTagFrameBody frameBody)

PairedTextEncodedStringNullTerminated

public PairedTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object)

PairedTextEncodedStringNullTerminated

public PairedTextEncodedStringNullTerminated(PairedTextEncodedStringNullTerminated object)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractDataType
Returns:
whether this and obj are deemed equivalent

getSize

public int getSize()
Returns the size in bytes of this dataType when written to file

Specified by:
getSize in class AbstractDataType
Returns:
size of this dataType

canBeEncoded

public boolean canBeEncoded()
Check the value can be encoded with the specified encoding

Returns:

readByteArray

public void readByteArray(byte[] arr,
                          int offset)
                   throws InvalidDataTypeException
Read Null Terminated Strings from the array starting at offset, continue until unable to find any null terminated Strings or until reached the end of the array. The offset should be set to byte after the last null terminated String found.

Specified by:
readByteArray in class AbstractDataType
Parameters:
arr - to read the Strings from
offset - in the array to start reading from
Throws:
InvalidDataTypeException - if unable to find any null terminated Strings

writeByteArray

public byte[] writeByteArray()
For every String write to byteBuffer

Specified by:
writeByteArray in class AbstractDataType
Returns:
byteBuffer that should be written to file to persist this dataType.

getValue

public PairedTextEncodedStringNullTerminated.ValuePairs getValue()
Description copied from class: AbstractDataType
Get value held by this Object

Overrides:
getValue in class AbstractDataType
Returns:
value held by this Object


Copyright © 2005-2010 java.net. All Rights Reserved.