Package org.apache.commons.imaging.formats.tiff

# Class TiffField

java.lang.Object
org.apache.commons.imaging.formats.tiff.TiffField

public class TiffField extends Object
A TIFF field in a TIFF directory. Immutable.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `final class`
  `TiffField.OversizeValueElement`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TiffField(int tag, int directoryType, AbstractFieldType abstractFieldType, long count, long offset, byte[] value, ByteOrder byteOrder, int sortHint)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dump()`
  `void`
  `dump(PrintWriter pw)`
  `void`
  `dump(PrintWriter pw, String prefix)`
  `byte[]`
  `getByteArrayValue()`
  Returns a copy of the raw value of the field.
  `ByteOrder`
  `getByteOrder()`
  Returns the field's byte order.
  `int`
  `getBytesLength()`
  The length of the field's value.
  `long`
  `getCount()`
  Returns the field's count, derived from bytes 4-7.
  `String`
  `getDescriptionWithoutValue()`
  `int`
  `getDirectoryType()`
  `double[]`
  `getDoubleArrayValue()`
  `double`
  `getDoubleValue()`
  `AbstractFieldType`
  `getFieldType()`
  Returns the field's type, derived from bytes 2-3.
  `String`
  `getFieldTypeName()`
  `int[]`
  `getIntArrayValue()`
  `int`
  `getIntValue()`
  `int`
  `getIntValueOrArraySum()`
  `long[]`
  `getLongArrayValue()`
  Gets the value of the field in the form of an array of eight-byte (long) integers.
  `long`
  `getLongValue()`
  Gets the value of the field in the form of an eight-byte (long) integer.
  `int`
  `getOffset()`
  Returns the TIFF field's offset/value field, derived from bytes 8-11.
  `AbstractTiffElement`
  `getOversizeValueElement()`
  `int`
  `getSortHint()`
  `String`
  `getStringValue()`
  `int`
  `getTag()`
  Returns the field's tag, derived from bytes 0-1.
  `TagInfo`
  `getTagInfo()`
  `String`
  `getTagName()`
  `Object`
  `getValue()`
  `String`
  `getValueDescription()`
  `boolean`
  `isLocalValue()`
  Indicates whether the field's value is inlined into the offset field.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### TiffField

    public TiffField(int tag, int directoryType, AbstractFieldType abstractFieldType, long count, long offset, byte[] value, ByteOrder byteOrder, int sortHint)

- ## Method Details

  - ### dump

    public void dump()

  - ### dump

    public void dump(PrintWriter pw)

  - ### dump

    public void dump(PrintWriter pw, String prefix)

  - ### getByteArrayValue

    public byte[] getByteArrayValue()
    Returns a copy of the raw value of the field.
    Returns:
      the value of the field, in the byte order of the field.

  - ### getByteOrder

    public ByteOrder getByteOrder()
    Returns the field's byte order.
    Returns:
      the byte order

  - ### getBytesLength

    public int getBytesLength()
    The length of the field's value.
    Returns:
      the length, in bytes.

  - ### getCount

    public long getCount()
    Returns the field's count, derived from bytes 4-7.
    Returns:
      the count

  - ### getDescriptionWithoutValue

    public String getDescriptionWithoutValue()

  - ### getDirectoryType

    public int getDirectoryType()

  - ### getDoubleArrayValue

    public double[] getDoubleArrayValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getDoubleValue

    public double getDoubleValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getFieldType

    public AbstractFieldType getFieldType()
    Returns the field's type, derived from bytes 2-3.
    Returns:
      the field's type, as a `FieldType` object.

  - ### getFieldTypeName

    public String getFieldTypeName()

  - ### getIntArrayValue

    public int[] getIntArrayValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getIntValue

    public int getIntValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getIntValueOrArraySum

    public int getIntValueOrArraySum() throws ImagingException
    Throws:
      `ImagingException`

  - ### getLongArrayValue

    public long[] getLongArrayValue() throws ImagingException
    Gets the value of the field in the form of an array of eight-byte (long) integers.
    Returns:
      an valid array of size zero or larger giving signed long integer values.
    Throws:
      `ImagingException` - if the field instance is of an incompatible type or does not contain a valid data element.

  - ### getLongValue

    public long getLongValue() throws ImagingException
    Gets the value of the field in the form of an eight-byte (long) integer.
    Returns:
      a signed long integer value.
    Throws:
      `ImagingException` - if the field instance is of an incompatible type or does not contain a valid data element.

  - ### getOffset

    public int getOffset()
    Returns the TIFF field's offset/value field, derived from bytes 8-11.
    Returns:
      the field's offset in a `long` of 4 packed bytes, or its inlined value <= 4 bytes long encoded in the field's byte order.

  - ### getOversizeValueElement

    public AbstractTiffElement getOversizeValueElement()

  - ### getSortHint

    public int getSortHint()

  - ### getStringValue

    public String getStringValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getTag

    public int getTag()
    Returns the field's tag, derived from bytes 0-1.
    Returns:
      the tag, as an `int` in which only the lowest 2 bytes are set

  - ### getTagInfo

    public TagInfo getTagInfo()

  - ### getTagName

    public String getTagName()

  - ### getValue

    public Object getValue() throws ImagingException
    Throws:
      `ImagingException`

  - ### getValueDescription

    public String getValueDescription()

  - ### isLocalValue

    public boolean isLocalValue()
    Indicates whether the field's value is inlined into the offset field.
    Returns:
      true if the value is inlined

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`