code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
833 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public List<Artwork> getArtworkList() { List<Artwork> artworkList = new ArrayList<Artwork>(1); //Read Old Format if(getArtworkBinaryData()!=null & getArtworkBinaryData().length>0) { Artwork artwork= ArtworkFactory.getNew(); artwork.setMimeType(getArtworkMimeType()); artwork.setBinaryData(getArtworkBinaryData()); artworkList.add(artwork); } //New Format (Supports Multiple Images) List<TagField> metadataBlockPics = this.get(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE); for(TagField tagField:metadataBlockPics) { try { byte[] imageBinaryData = Base64Coder.decode(((TagTextField)tagField).getContent()); MetadataBlockDataPicture coverArt = new MetadataBlockDataPicture(ByteBuffer.wrap(imageBinaryData)); Artwork artwork=ArtworkFactory.createArtworkFromMetadataBlockDataPicture(coverArt); artworkList.add(artwork); } catch(IOException ioe) { throw new RuntimeException(ioe); } catch(InvalidFrameException ife) { throw new RuntimeException(ife); } } return artworkList; }
@return list of artwork images
VorbisCommentTag::getArtworkList
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException { if(artwork.isLinked()) { return new MetadataBlockDataPicture( artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1), artwork.getPictureType(), MetadataBlockDataPicture.IMAGE_IS_URL, "", 0, 0, 0, 0); } else { if(!artwork.setImageFromData()) { throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered"); } return new MetadataBlockDataPicture(artwork.getBinaryData(), artwork.getPictureType(), artwork.getMimeType(), artwork.getDescription(), artwork.getWidth(), artwork.getHeight(), 0, 0); } }
Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but has to be base encoded to be stored in VorbisComment @return MetadataBlockDataPicture
VorbisCommentTag::createMetadataBlockDataPicture
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public TagField createField(Artwork artwork) throws FieldDataInvalidException { try { char[] testdata = Base64Coder.encode(createMetadataBlockDataPicture(artwork).getRawContent()); String base64image = new String(testdata); TagField imageTagField = createField(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE, base64image); return imageTagField; } catch(UnsupportedEncodingException uee) { throw new RuntimeException(uee); } }
Create Artwork field @param artwork @return @throws FieldDataInvalidException
VorbisCommentTag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void addField(Artwork artwork) throws FieldDataInvalidException { this.addField(createField(artwork)); }
Add artwork field @param artwork @throws FieldDataInvalidException
VorbisCommentTag::addField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void setField(String vorbisCommentKey, String value) throws KeyNotFoundException, FieldDataInvalidException { TagField tagfield = createField(vorbisCommentKey,value); setField(tagfield); }
Create and set field with name of vorbisCommentkey @param vorbisCommentKey @param value @throws KeyNotFoundException @throws FieldDataInvalidException
VorbisCommentTag::setField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void addField(String vorbisCommentKey, String value) throws KeyNotFoundException, FieldDataInvalidException { TagField tagfield = createField(vorbisCommentKey,value); addField(tagfield); }
Create and add field with name of vorbisCommentkey @param vorbisCommentKey @param value @throws KeyNotFoundException @throws FieldDataInvalidException
VorbisCommentTag::addField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public void deleteArtworkField() throws KeyNotFoundException { //New Method this.deleteField(VorbisCommentFieldKey.METADATA_BLOCK_PICTURE); //Old Method this.deleteField(VorbisCommentFieldKey.COVERART); this.deleteField(VorbisCommentFieldKey.COVERARTMIME); }
Delete all instance of artwork Field @throws KeyNotFoundException
VorbisCommentTag::deleteArtworkField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/VorbisCommentTag.java
Apache-2.0
public static String encode(final String s) { return new String(encode(s.getBytes(StandardCharsets.ISO_8859_1))); }
Encodes a string into Base64 format. No blanks or line breaks are inserted. @param s a String to be encoded. @return A String with the Base64 encoded data.
Base64Coder::encode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static char[] encode(final byte[] in) { final int iLen = in.length; final int oDataLen = (iLen * 4 + 2) / 3; // output length without padding final int oLen = ((iLen + 2) / 3) * 4; // output length including padding final char[] out = new char[oLen]; int ip = 0; int op = 0; while (ip < iLen) { final int i0 = in[ip++] & 0xff; final int i1 = ip < iLen ? in[ip++] & 0xff : 0; final int i2 = ip < iLen ? in[ip++] & 0xff : 0; final int o0 = i0 >>> 2; final int o1 = ((i0 & 3) << 4) | (i1 >>> 4); final int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); final int o3 = i2 & 0x3F; out[op++] = map1[o0]; out[op++] = map1[o1]; out[op] = op < oDataLen ? map1[o2] : '='; op++; out[op] = op < oDataLen ? map1[o3] : '='; op++; } return out; }
Encodes a byte array into Base64 format. No blanks or line breaks are inserted. @param in an array containing the data bytes to be encoded. @return A character array with the Base64 encoded data.
Base64Coder::encode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static byte[] decode(final String s) { return decode(s.toCharArray()); }
Decodes a Base64 string. @param s a Base64 String to be decoded. @return An array containing the decoded data bytes. @throws IllegalArgumentException if the input is not valid Base64 encoded data.
Base64Coder::decode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public static byte[] decode(final char[] in) { int iLen = in.length; if (iLen % 4 != 0) { throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4."); } while (iLen > 0 && in[iLen - 1] == '=') { iLen--; } final int oLen = (iLen * 3) / 4; final byte[] out = new byte[oLen]; int ip = 0; int op = 0; while (ip < iLen) { final int i0 = in[ip++]; final int i1 = in[ip++]; if(i0==13 && i1==10) continue; final int i2 = ip < iLen ? in[ip++] : 'A'; final int i3 = ip < iLen ? in[ip++] : 'A'; if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) { throw new IllegalArgumentException("Illegal character in Base64 encoded data."); } final int b0 = map2[i0]; final int b1 = map2[i1]; final int b2 = map2[i2]; final int b3 = map2[i3]; if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) { throw new IllegalArgumentException("Illegal character in Base64 encoded data."); } final int o0 = (b0 << 2) | (b1 >>> 4); final int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2); final int o2 = ((b2 & 3) << 6) | b3; out[op++] = (byte) o0; if (op < oLen) { out[op++] = (byte) o1; } if (op < oLen) { out[op++] = (byte) o2; } } return out; }
Decodes Base64 data. @param in a character array containing the Base64 encoded data. @return An array containing the decoded data bytes. @throws IllegalArgumentException if the input is not valid Base64 encoded data.
Base64Coder::decode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/vorbiscomment/util/Base64Coder.java
Apache-2.0
public AsfTagCoverField(final byte[] imageData, final int pictureType, final String description, final String mimeType) { super(new MetadataDescriptor(AsfFieldKey.COVER_ART.getFieldName(), MetadataDescriptor.TYPE_BINARY)); this.getDescriptor() .setBinaryValue( createRawContent(imageData, pictureType, description, mimeType)); }
Create New Image Field @param imageData @param pictureType @param description @param mimeType
AsfTagCoverField::AsfTagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
Apache-2.0
public AsfTagCoverField(final MetadataDescriptor source) { super(source); if (!source.getName().equals(AsfFieldKey.COVER_ART.getFieldName())) { throw new IllegalArgumentException( "Descriptor description must be WM/Picture"); } if (source.getType() != MetadataDescriptor.TYPE_BINARY) { throw new IllegalArgumentException("Descriptor type must be binary"); } try { processRawContent(); } catch (final UnsupportedEncodingException uee) { // Should never happen throw new RuntimeException(uee); // NOPMD by Christian Laireiter on 5/9/09 5:45 PM } }
Creates an instance from a metadata descriptor @param source The metadata descriptor, whose content is published.<br>
AsfTagCoverField::AsfTagCoverField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagCoverField.java
Apache-2.0
public AbstractAsfTagImageField(final AsfFieldKey field) { super(field); }
Creates a image tag field. @param field the ASF field that should be represented.
AbstractAsfTagImageField::AbstractAsfTagImageField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
Apache-2.0
public AbstractAsfTagImageField(final MetadataDescriptor source) { super(source); }
Creates an instance. @param source The descriptor which should be represented as a {@link TagField}.
AbstractAsfTagImageField::AbstractAsfTagImageField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
Apache-2.0
public AbstractAsfTagImageField(final String fieldKey) { super(fieldKey); }
Creates a tag field. @param fieldKey The field identifier to use.
AbstractAsfTagImageField::AbstractAsfTagImageField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
Apache-2.0
public Bitmap getImage() throws IOException { return BitmapFactory.decodeStream(new ByteArrayInputStream(getRawImageData())); }
This method returns an image instance from the {@linkplain #getRawImageData() image content}. @return the image instance @throws IOException
AbstractAsfTagImageField::getImage
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AbstractAsfTagImageField.java
Apache-2.0
public AsfTagTextField(final AsfFieldKey field, final String value) { super(field); toWrap.setString(value); }
Creates a tag text field and assigns the string value. @param field ASF field to represent. @param value the value to assign.
AsfTagTextField::AsfTagTextField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
Apache-2.0
public AsfTagTextField(final MetadataDescriptor source) { super(source); if (source.getType() == MetadataDescriptor.TYPE_BINARY) { throw new IllegalArgumentException( "Cannot interpret binary as string."); } }
Creates an instance. @param source The metadata descriptor, whose content is published.<br> Must not be of type {@link MetadataDescriptor#TYPE_BINARY}.
AsfTagTextField::AsfTagTextField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
Apache-2.0
public AsfTagTextField(final String fieldKey, final String value) { super(fieldKey); toWrap.setString(value); }
Creates a tag text field and assigns the string value. @param fieldKey The fields identifier. @param value the value to assign.
AsfTagTextField::AsfTagTextField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagTextField.java
Apache-2.0
public AsfTagField(final AsfFieldKey field) { assert field != null; this.toWrap = new MetadataDescriptor(field.getHighestContainer(), field .getFieldName(), MetadataDescriptor.TYPE_STRING); }
Creates a tag field. @param field the ASF field that should be represented.
AsfTagField::AsfTagField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagField.java
Apache-2.0
public MetadataDescriptor getDescriptor() { return this.toWrap; }
Returns the wrapped metadata descriptor (which actually stores the values). @return the wrapped metadata descriptor
AsfTagField::getDescriptor
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagField.java
Apache-2.0
public AsfTagBannerField() { super(AsfFieldKey.BANNER_IMAGE); }
Creates an instance with no image data.<br>
AsfTagBannerField::AsfTagBannerField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
Apache-2.0
public AsfTagBannerField(final MetadataDescriptor descriptor) { super(descriptor); assert descriptor.getName().equals( AsfFieldKey.BANNER_IMAGE.getFieldName()); }
Creates an instance with given descriptor as image content.<br> @param descriptor image content.
AsfTagBannerField::AsfTagBannerField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
Apache-2.0
public AsfTagBannerField(final byte[] imageData) { super(new MetadataDescriptor(ContainerType.CONTENT_BRANDING, AsfFieldKey.BANNER_IMAGE.getFieldName(), MetadataDescriptor.TYPE_BINARY)); this.toWrap.setBinaryValue(imageData); }
Creates an instance with specified data as image content. @param imageData image content.
AsfTagBannerField::AsfTagBannerField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTagBannerField.java
Apache-2.0
public AsfFieldIterator(final Iterator<TagField> iterator) { assert iterator != null; this.fieldIterator = iterator; }
Creates an isntance. @param iterator iterator to read from.
AsfFieldIterator::AsfFieldIterator
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTag(final boolean copy) { super(); this.copyFields = copy; }
Creates an instance and sets the field conversion property.<br> @param copy look at {@link #isCopyingFields()}.
AsfTag::AsfTag
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTag(final Tag source, final boolean copy) throws UnsupportedEncodingException { this(copy); copyFrom(source); }
Creates an instance and copies the fields of the source into the own structure.<br> @param source source to read tag fields from. @param copy look at {@link #isCopyingFields()}. @throws UnsupportedEncodingException {@link TagField#getRawContent()} which may be called
AsfTag::AsfTag
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public void addCopyright(final String copyRight) { addField(createCopyrightField(copyRight)); }
Creates a field for copyright and adds it.<br> @param copyRight copyright content
AsfTag::addCopyright
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public void addRating(final String rating) { addField(createRatingField(rating)); }
Creates a field for rating and adds it.<br> @param rating rating.
AsfTag::addRating
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
private void copyFrom(final Tag source) { final Iterator<TagField> fieldIterator = source.getFields(); // iterate over all fields while (fieldIterator.hasNext()) { final TagField copy = copyFrom(fieldIterator.next()); if (copy != null) { super.addField(copy); } } }
This method copies tag fields from the source.<br> @param source source to read tag fields from.
AsfTag::copyFrom
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
private TagField copyFrom(final TagField source) { TagField result; if (isCopyingFields()) { if (source instanceof AsfTagField) { try { result = (TagField) ((AsfTagField) source).clone(); } catch (CloneNotSupportedException e) { result = new AsfTagField(((AsfTagField) source).getDescriptor()); } } else if (source instanceof TagTextField) { final String content = ((TagTextField) source).getContent(); result = new AsfTagTextField(source.getId(), content); } else { throw new RuntimeException("Unknown Asf Tag Field class:" // NOPMD // by // Christian // Laireiter // on // 5/9/09 // 5:44 // PM + source.getClass()); } } else { result = source; } return result; }
If {@link #isCopyingFields()} is <code>true</code>, Creates a copy of <code>source</code>, if its not empty-<br> However, plain {@link TagField} objects can only be transformed into binary fields using their {@link TagField#getRawContent()} method.<br> @param source source field to copy. @return A copy, which is as close to the source as possible, or <code>null</code> if the field is empty (empty byte[] or blank string}.
AsfTag::copyFrom
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTagCoverField createField(final Artwork artwork) { return new AsfTagCoverField(artwork.getBinaryData(), artwork.getPictureType(), artwork.getDescription(), artwork.getMimeType()); }
Creates an {@link AsfTagCoverField} from given artwork @param artwork artwork to create a ASF field from. @return ASF field capable of storing artwork.
AsfTag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTagCoverField createArtworkField(final byte[] data) { return new AsfTagCoverField(data, PictureTypes.DEFAULT_ID, null, null); }
Create artwork field @param data raw image data @return creates a default ASF picture field with default {@linkplain PictureTypes#DEFAULT_ID picture type}.
AsfTag::createArtworkField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTagTextField createCopyrightField(final String content) { return new AsfTagTextField(AsfFieldKey.COPYRIGHT, content); }
Creates a field for storing the copyright.<br> @param content Copyright value. @return {@link AsfTagTextField}
AsfTag::createCopyrightField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTagTextField createRatingField(final String content) { return new AsfTagTextField(AsfFieldKey.RATING, content); }
Creates a field for storing the copyright.<br> @param content Rating value. @return {@link AsfTagTextField}
AsfTag::createRatingField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public AsfTagTextField createField(final AsfFieldKey asfFieldKey, final String value) { if (value == null) { throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg()); } if (asfFieldKey == null) { throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg()); } switch (asfFieldKey) { case COVER_ART: throw new UnsupportedOperationException("Cover Art cannot be created using this method"); case BANNER_IMAGE: throw new UnsupportedOperationException("Banner Image cannot be created using this method"); default: return new AsfTagTextField(asfFieldKey.getFieldName(), value); } }
Create tag text field using ASF key Uses the correct subclass for the key.<br> @param asfFieldKey field key to create field for. @param value string value for the created field. @return text field with given content.
AsfTag::createField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public void deleteField(final AsfFieldKey fieldKey) { super.deleteField(fieldKey.getFieldName()); }
Removes all fields which are stored to the provided field key. @param fieldKey fields to remove.
AsfTag::deleteField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public Iterator<AsfTagField> getAsfFields() { if (!isCopyingFields()) { throw new IllegalStateException("Since the field conversion is not enabled, this method cannot be executed"); } return new AsfFieldIterator(getFields()); }
This method iterates through all stored fields.<br> This method can only be used if this class has been created with field conversion turned on. @return Iterator for iterating through ASF fields.
AsfTag::getAsfFields
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public List<TagField> getCopyright() { return getFields(AsfFieldKey.COPYRIGHT.getFieldName()); }
Returns a list of stored copyrights. @return list of stored copyrights.
AsfTag::getCopyright
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public String getFirst(AsfFieldKey asfKey) throws KeyNotFoundException { if (asfKey == null) { throw new KeyNotFoundException(); } return super.getFirst(asfKey.getFieldName()); }
Retrieve the first value that exists for this asfkey @param asfKey @return @throws org.jaudiotagger.tag.KeyNotFoundException
AsfTag::getFirst
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public String getFirstCopyright() { return getFirst(AsfFieldKey.COPYRIGHT.getFieldName()); }
Returns the Copyright. @return the Copyright.
AsfTag::getFirstCopyright
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public String getFirstRating() { return getFirst(AsfFieldKey.RATING.getFieldName()); }
Returns the Rating. @return the Rating.
AsfTag::getFirstRating
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public List<TagField> getRating() { return getFields(AsfFieldKey.RATING.getFieldName()); }
Returns a list of stored ratings. @return list of stored ratings.
AsfTag::getRating
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public boolean isCopyingFields() { return this.copyFields; }
If <code>true</code>, the {@link #copyFrom(TagField)} method creates a new {@link AsfTagField} instance and copies the content from the source.<br> This method is utilized by {@link #addField(TagField)} and {@link #setField(TagField)}.<br> So if <code>true</code> it is ensured that the {@link AsfTag} instance has its own copies of fields, which cannot be modified after assignment (which could pass some checks), and it just stores {@link AsfTagField} objects.<br> Only then {@link #getAsfFields()} can work. otherwise {@link IllegalStateException} is thrown. @return state of field conversion.
AsfTag::isCopyingFields
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public void setCopyright(final String Copyright) { setField(createCopyrightField(Copyright)); }
Sets the copyright.<br> @param Copyright the copyright to set.
AsfTag::setCopyright
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public void setRating(final String rating) { setField(createRatingField(rating)); }
Sets the Rating.<br> @param rating the rating to set.
AsfTag::setRating
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public boolean hasField(AsfFieldKey asfFieldKey) { return getFields(asfFieldKey.getFieldName()).size() != 0; }
@param asfFieldKey @return
AsfTag::hasField
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfTag.java
Apache-2.0
public static AsfFieldKey getAsfFieldKey(final String fieldName) { AsfFieldKey result = FIELD_ID_MAP.get(fieldName); if (result == null) { result = CUSTOM; } return result; }
Searches for an ASF field key which represents the given id string.<br> @param fieldName the field name used for this key @return the Enum that represents this field
AsfFieldKey::getAsfFieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public static boolean isMultiValued(final String fieldName) { final AsfFieldKey fieldKey = getAsfFieldKey(fieldName); return fieldKey != null && fieldKey.isMultiValued(); }
Tests whether the field is enabled for multiple values.<br> @param fieldName field id to test. @return <code>true</code> if ASF implementation supports multiple values for the field.
AsfFieldKey::isMultiValued
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
AsfFieldKey(final String asfFieldName, final boolean multiValue) { this(asfFieldName, multiValue, ContainerType.EXTENDED_CONTENT, ContainerType.METADATA_LIBRARY_OBJECT); }
Creates an instance<br> Lowest/Highest will be {@link ContainerType#EXTENDED_CONTENT} / {@link ContainerType#METADATA_LIBRARY_OBJECT} @param asfFieldName standard field identifier. @param multiValue <code>true</code> if the this ASF field can have multiple values.
AsfFieldKey::AsfFieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
AsfFieldKey(final String asfFieldName, final boolean multiValue, final ContainerType restrictedTo) { this(asfFieldName, multiValue, restrictedTo, restrictedTo); }
Creates an instance.<br> @param asfFieldName standard field identifier. @param multiValue <code>true</code> if the this ASF field can have multiple values. @param restrictedTo fields must be stored in this container.
AsfFieldKey::AsfFieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
AsfFieldKey(final String asfFieldName, final boolean multiValue, final ContainerType lowest, final ContainerType highest) { this.fieldName = asfFieldName; assert !multiValue || highest.isMultiValued() : "Definition error"; this.multiValued = multiValue && highest.isMultiValued(); this.lowestContainer = lowest; this.highestContainer = highest; assert ContainerType.areInCorrectOrder(lowest, highest); }
Creates an instance.<br> @param asfFieldName standard field identifier. @param multiValue <code>true</code> if the this ASF field can have multiple values. @param lowest fields must be stored at least in this container. @param highest fields aren't allowed to be stored in better containers than this.
AsfFieldKey::AsfFieldKey
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public String getFieldName() { return this.fieldName; }
Returns the standard field id. @return the standard field id. (may be <code>null</code>)
AsfFieldKey::getFieldName
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public ContainerType getHighestContainer() { return this.highestContainer; }
@return the highestContainer
AsfFieldKey::getHighestContainer
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public ContainerType getLowestContainer() { return this.lowestContainer; }
@return the lowestContainer
AsfFieldKey::getLowestContainer
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public boolean isMultiValued() { return this.multiValued; }
Returns <code>true</code> if this field can store multiple values. @return <code>true</code> if multiple values are supported for this field.
AsfFieldKey::isMultiValued
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/asf/AsfFieldKey.java
Apache-2.0
public static int getMaxStandardGenreId() { return MAX_STANDARD_GENRE_ID; }
@return the maximum genreId that is part of the official Standard, genres above this were added by Winamp later.
GenreTypes::getMaxStandardGenreId
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/reference/GenreTypes.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/reference/GenreTypes.java
Apache-2.0
public Integer getIdForName(String name) { return nameToIdMap.get(name.toLowerCase()); }
Get Id for name, match is not case sensitive @param name genre name @return id or {@code null}, if not found
GenreTypes::getIdForName
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/reference/GenreTypes.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/reference/GenreTypes.java
Apache-2.0
public static Country getCountryByCode(String code) { return codeMap.get(code); }
@param code @return enum with this two letter code
ISOCountry::getCountryByCode
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/reference/ISOCountry.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/reference/ISOCountry.java
Apache-2.0
public static Country getCountryByDescription(String description) { return descriptionMap.get(description); }
@param description @return enum with this description
ISOCountry::getCountryByDescription
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/reference/ISOCountry.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/reference/ISOCountry.java
Apache-2.0
public final byte getTextEncoding() { AbstractDataType o = getObject(DataTypes.OBJ_TEXT_ENCODING); if (o != null) { Long encoding = (Long) (o.getValue()); return encoding.byteValue(); } else { return TextEncoding.ISO_8859_1; } }
Return the Text Encoding @return the text encoding used by this framebody
AbstractTagFrameBody::getTextEncoding
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public final void setTextEncoding(byte textEncoding) { //Number HashMap actually converts this byte to a long setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding); }
Set the Text Encoding to use for this frame body @param textEncoding to use for this frame body
AbstractTagFrameBody::setTextEncoding
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
protected AbstractTagFrameBody() { setupObjectList(); }
Creates a new framebody, at this point the bodys ObjectList is setup which defines what datatypes are expected in body
AbstractTagFrameBody::AbstractTagFrameBody
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
protected AbstractTagFrameBody(AbstractTagFrameBody copyObject) { AbstractDataType newObject; for (int i = 0; i < copyObject.objectList.size(); i++) { newObject = (AbstractDataType) ID3Tags.copyObject(copyObject.objectList.get(i)); newObject.setBody(this); this.objectList.add(newObject); } }
Copy Constructor for fragment body. Copies all objects in the Object Iterator with data. @param copyObject
AbstractTagFrameBody::AbstractTagFrameBody
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public String getUserFriendlyValue() { return toString(); }
@return the text value that the user would expect to see for this framebody type, this should be overridden for all frame-bodies
AbstractTagFrameBody::getUserFriendlyValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public String getBriefDescription() { String str = ""; for (AbstractDataType object : objectList) { if ((object.toString() != null) && (object.toString().length() > 0)) { str += (object.getIdentifier() + "=\"" + object + "\"; "); } } return str; }
This method calls <code>toString</code> for all it's objects and appends them without any newline characters. @return brief description string
AbstractTagFrameBody::getBriefDescription
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public final String getLongDescription() { String str = ""; for (AbstractDataType object : objectList) { if ((object.toString() != null) && (object.toString().length() > 0)) { str += (object.getIdentifier() + " = " + object + "\n"); } } return str; }
This method calls <code>toString</code> for all it's objects and appends them. It contains new line characters and is more suited for display purposes @return formatted description string
AbstractTagFrameBody::getLongDescription
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public final void setObjectValue(String identifier, Object value) { AbstractDataType object; Iterator<AbstractDataType> iterator = objectList.listIterator(); while (iterator.hasNext()) { object = iterator.next(); if (object.getIdentifier().equals(identifier)) { object.setValue(value); } } }
Sets all objects of identifier type to value defined by <code>obj</code> argument. @param identifier <code>MP3Object</code> identifier @param value new datatype value
AbstractTagFrameBody::setObjectValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public final Object getObjectValue(String identifier) { return getObject(identifier).getValue(); }
Returns the value of the datatype with the specified <code>identifier</code> @param identifier @return the value of the dattype with the specified <code>identifier</code>
AbstractTagFrameBody::getObjectValue
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public final AbstractDataType getObject(String identifier) { AbstractDataType object; Iterator<AbstractDataType> iterator = objectList.listIterator(); while (iterator.hasNext()) { object = iterator.next(); if (object.getIdentifier().equals(identifier)) { return object; } } return null; }
Returns the datatype with the specified <code>identifier</code> @param identifier @return the datatype with the specified <code>identifier</code>
AbstractTagFrameBody::getObject
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public int getSize() { int size = 0; AbstractDataType object; Iterator<AbstractDataType> iterator = objectList.listIterator(); while (iterator.hasNext()) { object = iterator.next(); size += object.getSize(); } return size; }
Returns the size in bytes of this fragmentbody @return estimated size in bytes of this datatype
AbstractTagFrameBody::getSize
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public boolean isSubsetOf(Object obj) { if (!(obj instanceof AbstractTagFrameBody)) { return false; } ArrayList<AbstractDataType> superset = ((AbstractTagFrameBody) obj).objectList; for (AbstractDataType anObjectList : objectList) { if (anObjectList.getValue() != null) { if (!superset.contains(anObjectList)) { return false; } } } return true; }
Returns true if this instance and its entire DataType array list is a subset of the argument. This class is a subset if it is the same class as the argument. @param obj datatype to determine subset of @return true if this instance and its entire datatype array list is a subset of the argument.
AbstractTagFrameBody::isSubsetOf
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public boolean equals(Object obj) { if (!(obj instanceof AbstractTagFrameBody object)) { return false; } boolean check =this.objectList.equals(object.objectList) && super.equals(obj); return check; }
Returns true if this datatype and its entire DataType array list equals the argument. This datatype is equal to the argument if they are the same class. @param obj datatype to determine equality of @return true if this datatype and its entire <code>MP3Object</code> array list equals the argument.
AbstractTagFrameBody::equals
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public Iterator iterator() { return objectList.iterator(); }
Returns an iterator of the DataType list. @return iterator of the DataType list.
AbstractTagFrameBody::iterator
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public String toString() { return getBriefDescription(); }
Return brief description of FrameBody @return brief description of FrameBody
AbstractTagFrameBody::toString
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public AbstractTagFrame getHeader() { return header; }
Get Reference to header @return
AbstractTagFrameBody::getHeader
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public void setHeader(AbstractTagFrame header) { this.header = header; }
Set header @param header
AbstractTagFrameBody::setHeader
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrameBody.java
Apache-2.0
public AbstractTagFrame(AbstractTagFrame copyObject) { this.frameBody = (AbstractTagFrameBody) ID3Tags.copyObject(copyObject.frameBody); this.frameBody.setHeader(this); }
This constructs the bodies copy constructor this in turn invokes * bodies objectlist. @param copyObject
AbstractTagFrame::AbstractTagFrame
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
Apache-2.0
public void setBody(AbstractTagFrameBody frameBody) { this.frameBody = frameBody; this.frameBody.setHeader(this); }
Sets the body datatype for this fragment. The body datatype contains the actual information for the fragment. @param frameBody the body datatype
AbstractTagFrame::setBody
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
Apache-2.0
public AbstractTagFrameBody getBody() { return this.frameBody; }
Returns the body datatype for this fragment. The body datatype contains the actual information for the fragment. @return the body datatype
AbstractTagFrame::getBody
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
Apache-2.0
public boolean isSubsetOf(Object obj) { if (!(obj instanceof AbstractTagFrame)) { return false; } if ((frameBody == null) && (((AbstractTagFrame) obj).frameBody == null)) { return true; } if ((frameBody == null) || (((AbstractTagFrame) obj).frameBody == null)) { return false; } return frameBody.isSubsetOf(((AbstractTagFrame) obj).frameBody) && super.isSubsetOf(obj); }
Returns true if this datatype and it's body is a subset of the argument. This datatype is a subset if the argument is the same class. @param obj datatype to determine if subset of @return true if this datatype and it's body is a subset of the argument.
AbstractTagFrame::isSubsetOf
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
Apache-2.0
public boolean equals(Object obj) { if ( this == obj ) return true; if (!(obj instanceof AbstractTagFrame that)) { return false; } return EqualsUtil.areEqual(this.getIdentifier(), that.getIdentifier()) && EqualsUtil.areEqual(this.frameBody, that.frameBody) && super.equals(that); }
Returns true if this datatype and its body equals the argument and its body. this datatype is equal if and only if they are the same class and have the same <code>getSubId</code> id string. @param obj datatype to determine equality of @return true if this datatype and its body equals the argument and its body.
AbstractTagFrame::equals
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/AbstractTagFrame.java
Apache-2.0
public static boolean isID3v22FrameIdentifier(String identifier) { //If less than 3 cant be an identifier if (identifier.length() < 3) { return false; } //If 3 is it a known identifier else return identifier.length() == 3 && ID3v22Frames.getInstanceOf().getIdToValueMap().containsKey(identifier); }
Returns true if the identifier is a valid ID3v2.2 frame identifier @param identifier string to test @return true if the identifier is a valid ID3v2.2 frame identifier
ID3Tags::isID3v22FrameIdentifier
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static boolean isID3v23FrameIdentifier(String identifier) { return identifier.length() >= 4 && ID3v23Frames.getInstanceOf().getIdToValueMap().containsKey(identifier.substring(0, 4)); }
Returns true if the identifier is a valid ID3v2.3 frame identifier @param identifier string to test @return true if the identifier is a valid ID3v2.3 frame identifier
ID3Tags::isID3v23FrameIdentifier
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static boolean isID3v24FrameIdentifier(String identifier) { return identifier.length() >= 4 && ID3v24Frames.getInstanceOf().getIdToValueMap().containsKey(identifier.substring(0, 4)); }
Returns true if the identifier is a valid ID3v2.4 frame identifier @param identifier string to test @return true if the identifier is a valid ID3v2.4 frame identifier
ID3Tags::isID3v24FrameIdentifier
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
static public long getWholeNumber(Object value) { long number; if (value instanceof String) { number = Long.parseLong((String) value); } else if (value instanceof Byte) { number = (Byte) value; } else if (value instanceof Short) { number = (Short) value; } else if (value instanceof Integer) { number = (Integer) value; } else if (value instanceof Long) { number = (Long) value; } else { throw new IllegalArgumentException("Unsupported value class: " + value.getClass().getName()); } return number; }
Given an datatype, try to return it as a <code>long</code>. This tries to parse a string, and takes <code>Long, Short, Byte, Integer</code> objects and gets their value. An exception is not explicitly thrown here because it would causes too many other methods to also throw it. @param value datatype to find long from. @return <code>long</code> value @throws IllegalArgumentException
ID3Tags::getWholeNumber
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String convertFrameID22To23(String identifier) { if (identifier.length() < 3) { return null; } return ID3Frames.convertv22Tov23.get((String)identifier.subSequence(0, 3)); }
Convert from ID3v22 FrameIdentifier to ID3v23 @param identifier @return
ID3Tags::convertFrameID22To23
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String convertFrameID22To24(String identifier) { //Idv22 identifiers are only of length 3 times if (identifier.length() < 3) { return null; } //Has idv22 been mapped to v23 String id = ID3Frames.convertv22Tov23.get(identifier.substring(0, 3)); if (id != null) { //has v2.3 been mapped to v2.4 String v23id = ID3Frames.convertv23Tov24.get(id); if (v23id == null) { //if not it may be because v2.3 and and v2.4 are same so wont be //in mapping if (ID3v24Frames.getInstanceOf().getIdToValueMap().get(id) != null) { return id; } else { return null; } } else { return v23id; } } else { return null; } }
Convert from ID3v22 FrameIdentifier to ID3v24 @param identifier @return
ID3Tags::convertFrameID22To24
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String convertFrameID23To22(String identifier) { if (identifier.length() < 4) { return null; } //If it is a v23 identifier if (ID3v23Frames.getInstanceOf().getIdToValueMap().containsKey(identifier)) { //If only name has changed v22 and modified in v23 return result of. return ID3Frames.convertv23Tov22.get(identifier.substring(0, 4)); } return null; }
Convert from ID3v23 FrameIdentifier to ID3v22 @param identifier @return
ID3Tags::convertFrameID23To22
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String convertFrameID23To24(String identifier) { if (identifier.length() < 4) { return null; } //If it is a ID3v23 identifier if (ID3v23Frames.getInstanceOf().getIdToValueMap().containsKey(identifier)) { //If no change between ID3v23 and ID3v24 should be in ID3v24 list. if (ID3v24Frames.getInstanceOf().getIdToValueMap().containsKey(identifier)) { return identifier; } //If only name has changed ID3v23 and modified in ID3v24 return result of. else { return ID3Frames.convertv23Tov24.get(identifier.substring(0, 4)); } } return null; }
Convert from ID3v23 FrameIdentifier to ID3v24 @param identifier @return
ID3Tags::convertFrameID23To24
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String forceFrameID22To23(String identifier) { return ID3Frames.forcev22Tov23.get(identifier); }
Force from ID3v22 FrameIdentifier to ID3v23, this is where the frame and structure has changed from v2 to v3 but we can still do some kind of conversion. @param identifier @return
ID3Tags::forceFrameID22To23
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String forceFrameID23To24(String identifier) { return ID3Frames.forcev23Tov24.get(identifier); }
Force from ID3v2.30 FrameIdentifier to ID3v2.40, this is where the frame and structure has changed from v3 to v4 but we can still do some kind of conversion. @param identifier @return
ID3Tags::forceFrameID23To24
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String forceFrameID24To23(String identifier) { return ID3Frames.forcev24Tov23.get(identifier); }
Force from ID3v2.40 FrameIdentifier to ID3v2.30, this is where the frame and structure has changed between v4 to v3 but we can still do some kind of conversion. @param identifier @return
ID3Tags::forceFrameID24To23
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String convertFrameID24To23(String identifier) { String id; if (identifier.length() < 4) { return null; } id = ID3Frames.convertv24Tov23.get(identifier); if (id == null) { if (ID3v23Frames.getInstanceOf().getIdToValueMap().containsKey(identifier)) { id = identifier; } } return id; }
Convert from ID3v24 FrameIdentifier to ID3v23 @param identifier @return
ID3Tags::convertFrameID24To23
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static Object copyObject(Object copyObject) { Constructor<?> constructor; Class<?>[] constructorParameterArray; Object[] parameterArray; if (copyObject == null) { return null; } try { constructorParameterArray = new Class[1]; constructorParameterArray[0] = copyObject.getClass(); constructor = copyObject.getClass().getConstructor(constructorParameterArray); parameterArray = new Object[1]; parameterArray[0] = copyObject; return constructor.newInstance(parameterArray); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException("NoSuchMethodException: Error finding constructor to create copy:"+copyObject.getClass().getName()); } catch (IllegalAccessException ex) { throw new IllegalArgumentException("IllegalAccessException: No access to run constructor to create copy"+copyObject.getClass().getName()); } catch (InstantiationException ex) { throw new IllegalArgumentException("InstantiationException: Unable to instantiate constructor to copy"+copyObject.getClass().getName()); } catch (java.lang.reflect.InvocationTargetException ex) { if (ex.getCause() instanceof Error) { throw (Error) ex.getCause(); } else if (ex.getCause() instanceof RuntimeException) { throw (RuntimeException) ex.getCause(); } else { throw new IllegalArgumentException("InvocationTargetException: Unable to invoke constructor to create copy"); } } }
Unable to instantiate abstract classes, so can't call the copy constructor. So find out the instantiated class name and call the copy constructor through reflection (e.g for a a FrameBody would have to have a constructor that takes another frameBody as the same type as a parameter) @param copyObject @return @throws IllegalArgumentException if no suitable constructor exists
ID3Tags::copyObject
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static long findNumber(String str) throws TagException { return findNumber(str, 0); }
Find the first whole number that can be parsed from the string @param str string to search @return first whole number that can be parsed from the string @throws TagException
ID3Tags::findNumber
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static long findNumber(String str, int offset) throws TagException { if (str == null) { throw new NullPointerException("String is null"); } if ((offset < 0) || (offset >= str.length())) { throw new IndexOutOfBoundsException("Offset to image string is out of bounds: offset = " + offset + ", string.length()" + str.length()); } int i; int j; long num; i = offset; while (i < str.length()) { if (((str.charAt(i) >= '0') && (str.charAt(i) <= '9')) || (str.charAt(i) == '-')) { break; } i++; } j = i + 1; while (j < str.length()) { if (((str.charAt(j) < '0') || (str.charAt(j) > '9'))) { break; } j++; } if ((j <= str.length()) && (j > i)) { String toParseNumberFrom = str.substring(i, j); if(!toParseNumberFrom.equals("-")) num = Long.parseLong(toParseNumberFrom); else throw new TagException("Unable to find integer in string: " + str); } else { throw new TagException("Unable to find integer in string: " + str); } return num; }
Find the first whole number that can be parsed from the string @param str string to search @param offset start seaching from this index @return first whole number that can be parsed from the string @throws TagException @throws NullPointerException @throws IndexOutOfBoundsException
ID3Tags::findNumber
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
static public String stripChar(String str, char ch) { if (str != null) { char[] buffer = new char[str.length()]; int next = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) != ch) { buffer[next++] = str.charAt(i); } } return new String(buffer, 0, next); } else { return null; } }
Remove all occurances of the given character from the string argument. @param str String to search @param ch character to remove @return new String without the given charcter
ID3Tags::stripChar
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0
public static String truncate(String str, int len) { if (str == null) { return null; } if (len < 0) { return null; } if (str.length() > len) { return str.substring(0, len); } else { return str; } }
truncate a string if it longer than the argument @param str String to truncate @param len maximum desired length of new string @return
ID3Tags::truncate
java
ZTFtrue/MonsterMusic
app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/tag/id3/ID3Tags.java
Apache-2.0