com.beaglebuddy.ape

## Class APEItem

- java.lang.Object
- - com.beaglebuddy.ape.APEItem

-     public class APEItem
      extends java.lang.Object

  This class provides methods for reading the APE Items in an `APE tag`. An Item consists of a `key`/`value` pair. While the key part of an item is always a String, the value may be a String or it may be raw binary data, such as an image file. The sample code shown in the `APETag` demonstrates how to read the values stored in items an APE tag. The APE specification(s) have defined a standardized list of keys, but users are not restricted to this list.

  See Also:
    APEv1 Specification, APEv2 Specification

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `APEItem(byte[] bytes, int index)` constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBinaryValue()` gets the value as binary.
    `APEFlags` | `getFlags()` gets the flags associated with the APE item.
    `java.lang.String` | `getKey()` gets the key associated with the text/binary value.
    `int` | `getSize()` gets the size (inn bytes) of the APE item.
    `java.lang.String` | `getTextValue()` gets the value as UTF-8 encoded text.
    `APEFlags.Type` | `getType()` gets the type of data stored in the value.
    `boolean` | `isValueBinary()` gets whether the value is binary.
    `boolean` | `isValueText()` gets whether the value is text.
    `java.lang.String` | `toString()` gets a string representation of the APE item.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### APEItem

          public APEItem(byte[] bytes,
                 int index)

      constructor.
      Parameters:
        `bytes` - APE Item bytes.
        `index` - index into the byte array.

  - ### Method Detail

    - #### getSize

          public int getSize()

      gets the size (inn bytes) of the APE item.
      Returns:
        the size (inn bytes) of the APE item.

    - #### getFlags

          public APEFlags getFlags()

      gets the flags associated with the APE item.
      Returns:
        the flags associated with the APE item.

    - #### getKey

          public java.lang.String getKey()

      gets the key associated with the text/binary value. The key is encoded as ISO-8859-1 text.
      Returns:
        the key associated with the text/binary value.

    - #### getType

          public APEFlags.Type getType()

      gets the type of data stored in the value.
      Returns:
        the type of data stored in the value.

    - #### isValueText

          public boolean isValueText()

      gets whether the value is text.
      Returns:
        whether the value is text.

    - #### isValueBinary

          public boolean isValueBinary()

      gets whether the value is binary.
      Returns:
        whether the value is binary.

    - #### getTextValue

          public java.lang.String getTextValue()

      gets the value as UTF-8 encoded text.
      Returns:
        the value as UTF-8 encoded text.

    - #### getBinaryValue

          public byte[] getBinaryValue()

      gets the value as binary.
      Returns:
        the value as binary.

    - #### toString

          public java.lang.String toString()

      gets a string representation of the APE item.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the APE item.