Package org.apache.commons.imaging.formats.jpeg.segments

# Class AbstractSegment

java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.jpeg.segments.AbstractSegment

Direct Known Subclasses:
  `AbstractGenericSegment`, `DhtSegment`, `DqtSegment`, `JfifSegment`, `SofnSegment`, `SosSegment`

public abstract class AbstractSegment extends BinaryFileParser
Abstracts segment implementations.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final int`
  `length`
  Segment length.
  `final int`
  `marker`
  Segment marker.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractSegment(int marker, int length)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dump(PrintWriter pw)`
  `abstract String`
  `getDescription()`
  Gets the description.
  `String`
  `getSegmentType()`
  Gets the type.
  `String`
  `toString()`

  ### Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser

  `debugNumber, debugNumber, getByteOrder, setByteOrder`

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

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

- ## Field Details

  - ### marker

    public final int marker
    Segment marker.

  - ### length

    public final int length
    Segment length.

- ## Constructor Details

  - ### AbstractSegment

    public AbstractSegment(int marker, int length)
    Constructs a new instance.
    Parameters:
      `marker` - segment marker.
      `length` - segment length.

- ## Method Details

  - ### dump

    public void dump(PrintWriter pw)

  - ### getDescription

    public abstract String getDescription()
    Gets the description.
    Returns:
      the description.

  - ### getSegmentType

    public String getSegmentType()
    Gets the type.
    Returns:
      the type.

  - ### toString

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