public class AiffTag extends Object implements Tag, Id3SupportingTag
Constructor and Description |
---|
AiffTag() |
AiffTag(AbstractID3v2Tag t) |
AiffTag(String loggingFilename) |
Modifier and Type | Method and Description |
---|---|
void |
addChunkSummary(ChunkSummary cs) |
void |
addField(Artwork artwork)
Create artwork field based on the data in artwork and then add it to the tag itself
|
void |
addField(FieldKey genericKey,
String... value)
Create the field based on the generic key and add it to the tag
This is handled differently by different formats
|
void |
addField(TagField field)
Adds a field to the structure, used internally by the library
|
TagField |
createCompilationField(boolean value)
Creates isCompilation field
It is useful to have this method because it handles ensuring that the correct value to represent a boolean
is stored in the underlying field format.
|
static AbstractID3v2Tag |
createDefaultID3Tag()
Default based on user option
|
TagField |
createField(Artwork artwork)
Create artwork field.
|
TagField |
createField(FieldKey genericKey,
String... value)
Create a new field based on generic key, used internally by the library
|
void |
deleteArtworkField()
Delete all instance of artwork Field
|
void |
deleteField(FieldKey fieldKey)
Delete any instance of tag fields with this key
|
void |
deleteField(String id)
Delete any fields with this Flac (Vorbis Comment) id
|
boolean |
equals(Object obj) |
List<String> |
getAll(FieldKey genericKey)
Maps the generic key to the specific key and return the list of values for this field as strings
|
List<Artwork> |
getArtworkList() |
List<ChunkSummary> |
getChunkSummaryList() |
long |
getEndLocationInFileOfId3Chunk() |
int |
getFieldCount()
Return the number of fields
|
int |
getFieldCountIncludingSubValues()
Return the number of fields taking multiple value fields into consideration
Fields that actually contain multiple values are counted seperately
i.e.
|
Iterator<TagField> |
getFields()
Iterator over all the fields within the tag, handle multiple fields with the same id
|
List<TagField> |
getFields(FieldKey id)
|
List<TagField> |
getFields(String id)
|
long |
getFileSize() |
String |
getFirst(FieldKey id)
Retrieve String value of the first tag field that exists for this generic key
|
String |
getFirst(String id)
Retrieve String value of the first value that exists for this format specific key
|
Artwork |
getFirstArtwork() |
TagField |
getFirstField(FieldKey genericKey) |
TagField |
getFirstField(String id)
Retrieve the first field that exists for this format specific key
|
long |
getFormSize()
Size returned by the FORM header, this lets us know where the enclosing FORM headeer
thinks is the end of file, allowing us to identify bad data at end of file
|
AbstractID3v2Tag |
getID3Tag()
Returns the ID3 tag
|
long |
getSizeOfID3TagIncludingChunkHeader() |
long |
getSizeOfID3TagOnly() |
long |
getStartLocationInFileOfId3Chunk()
Offset into file of start ID3Chunk including header
|
String |
getValue(FieldKey id,
int index)
Retrieve String value of the nth tag field that exists for this generic key
|
boolean |
hasCommonFields()
|
boolean |
hasField(FieldKey genericKey)
Determines whether the tag has at least one field with the specified field key.
|
boolean |
hasField(String id)
Determines whether the tag has at least one field with the specified
"id".
|
boolean |
isEmpty()
Determines whether the tag has no fields specified.
|
boolean |
isExistingId3Tag() |
boolean |
isIncorrectlyAlignedTag() |
boolean |
isLastChunkSizeExtendsPastFormSize()
If the file is larger than the size reported by the FORM size header and the last chunk
extends into this area past the size reported by FORM header then indicates the FORM header is incorrect
rather than just extra non iff data at file end
|
boolean |
setEncoding(Charset enc) |
void |
setExistingId3Tag(boolean isExistingId3Tag) |
void |
setField(Artwork artwork)
Create artwork field based on the data in artwork and then set it in the tag itself
|
void |
setField(FieldKey genericKey,
String... value)
Create the field based on the generic key and set it in the tag
|
void |
setField(TagField field)
Sets a field in the structure, used internally by the library
|
void |
setFileSize(long fileSize) |
void |
setFormSize(long formSize) |
void |
setID3Tag(AbstractID3v2Tag t)
Sets the ID3 tag
|
void |
setIncorrectlyAlignedTag(boolean isIncorrectlyAlignedTag) |
void |
setLastChunkSizeExtendsPastFormSize(boolean lastChunkSizeExtendsPastFormSize) |
String |
toString() |
public AiffTag(String loggingFilename)
public AiffTag()
public AiffTag(AbstractID3v2Tag t)
public void addChunkSummary(ChunkSummary cs)
public List<ChunkSummary> getChunkSummaryList()
public boolean isExistingId3Tag()
public void setExistingId3Tag(boolean isExistingId3Tag)
public AbstractID3v2Tag getID3Tag()
getID3Tag
in interface Id3SupportingTag
public void setID3Tag(AbstractID3v2Tag t)
setID3Tag
in interface Id3SupportingTag
public void addField(TagField field) throws FieldDataInvalidException
Tag
addField
in interface Tag
field
- The field to add.FieldDataInvalidException
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
getAll
in interface Tag
genericKey
- KeyNotFoundException
public boolean hasCommonFields()
Tag
hasCommonFields
in interface Tag
true
if a common
field is present.public boolean isEmpty()
If there are no images we return empty if either there is no VorbisTag or if there is a VorbisTag but it is empty
public void setField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
Tag
setField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public void addField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
Tag
addField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public void setField(TagField field) throws FieldDataInvalidException
Tag
setField
in interface Tag
field
- FieldDataInvalidException
public TagField createField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
Tag
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField. Usually the value field should only be one value, but certain fields may require more than one value currently the only field to require this is the MUSICIAN field, it should contain instrument and then performer name
createField
in interface Tag
genericKey
- is the generic keyvalue
- to storeKeyNotFoundException
FieldDataInvalidException
public String getFirst(String id)
Tag
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
public String getValue(FieldKey id, int index) throws KeyNotFoundException
Tag
getValue
in interface Tag
KeyNotFoundException
public String getFirst(FieldKey id) throws KeyNotFoundException
Tag
getFirst
in interface Tag
KeyNotFoundException
public TagField getFirstField(String id)
Tag
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
getFirstField
in interface Tag
id
- audio specific keypublic TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
getFirstField
in interface Tag
KeyNotFoundException
public void deleteField(FieldKey fieldKey) throws KeyNotFoundException
deleteField
in interface Tag
fieldKey
- KeyNotFoundException
public void deleteField(String id) throws KeyNotFoundException
Tag
deleteField
in interface Tag
KeyNotFoundException
public Iterator<TagField> getFields()
Tag
public int getFieldCount()
Tag
Fields with the same identifiers are counted separately i.e two TITLE fields in a Vorbis Comment file would count as two
getFieldCount
in interface Tag
public int getFieldCountIncludingSubValues()
Tag
getFieldCountIncludingSubValues
in interface Tag
public boolean setEncoding(Charset enc) throws FieldDataInvalidException
setEncoding
in interface Tag
FieldDataInvalidException
public TagField createField(Artwork artwork) throws FieldDataInvalidException
createField
in interface Tag
FieldDataInvalidException
public void setField(Artwork artwork) throws FieldDataInvalidException
Tag
setField
in interface Tag
FieldDataInvalidException
public void addField(Artwork artwork) throws FieldDataInvalidException
Tag
addField
in interface Tag
FieldDataInvalidException
public List<Artwork> getArtworkList()
getArtworkList
in interface Tag
public List<TagField> getFields(FieldKey id) throws KeyNotFoundException
Tag
getFields
in interface Tag
id
- The field id.TagField
objects with the given "id".KeyNotFoundException
public Artwork getFirstArtwork()
getFirstArtwork
in interface Tag
public void deleteArtworkField() throws KeyNotFoundException
deleteArtworkField
in interface Tag
KeyNotFoundException
public boolean hasField(FieldKey genericKey)
Tag
public boolean hasField(String id)
Tag
public TagField createCompilationField(boolean value) throws KeyNotFoundException, FieldDataInvalidException
Tag
createCompilationField
in interface Tag
KeyNotFoundException
FieldDataInvalidException
public String toString()
public long getSizeOfID3TagOnly()
public long getSizeOfID3TagIncludingChunkHeader()
public long getStartLocationInFileOfId3Chunk()
public long getEndLocationInFileOfId3Chunk()
public boolean isIncorrectlyAlignedTag()
public void setIncorrectlyAlignedTag(boolean isIncorrectlyAlignedTag)
public static AbstractID3v2Tag createDefaultID3Tag()
public long getFormSize()
public void setFormSize(long formSize)
public boolean isLastChunkSizeExtendsPastFormSize()
public void setLastChunkSizeExtendsPastFormSize(boolean lastChunkSizeExtendsPastFormSize)
public long getFileSize()
public void setFileSize(long fileSize)
Copyright © 2005–2020 jthink.net. All rights reserved.