Class AbstractFieldType
java.lang.Object
org.apache.commons.imaging.formats.tiff.fieldtypes.AbstractFieldType
- Direct Known Subclasses:
FieldTypeAscii,FieldTypeByte,FieldTypeDouble,FieldTypeFloat,FieldTypeLong,FieldTypeLong8,FieldTypeRational,FieldTypeShort
TIFF field types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<AbstractFieldType> Unmodifiable List of all field types.static final FieldTypeAsciiASCII field type.static final List<AbstractFieldType> Unmodifiable List of ASCII, BYTE field types.static final List<AbstractFieldType> Unmodifiable List of ASCII, RATIONAL field types.static final FieldTypeByteByte field type.static final List<AbstractFieldType> Unmodifiable List of SHORT, BYTE field types.static final FieldTypeDoubleDouble field type.static final FieldTypeFloatFloat field type.static final FieldTypeLongIFD field type.static final FieldTypeLong8IFD8 field type.static final FieldTypeLongLong field type.static final List<AbstractFieldType> Unmodifiable List of LONG, IFD field types.static final List<AbstractFieldType> Unmodifiable List of SHORT, LONG field types.static final FieldTypeLong8Long8 field type.static final FieldTypeRationalRational field type.static final FieldTypeByteSByte field type.static final FieldTypeShortShort field type.static final List<AbstractFieldType> Unmodifiable List of SHORT, LONG field types.static final List<AbstractFieldType> Unmodifiable List of SHORT, LONG, RATIONAL field types.static final List<AbstractFieldType> Unmodifiable List of SHORT, RATIONAL field types.static final FieldTypeLongSLong field type.static final FieldTypeLong8SLong8 field type.static final FieldTypeRationalSRational field type.static final FieldTypeShortSShort field type.static final FieldTypeByteUndefined field type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFieldType(int type, String name, int elementSize) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractFieldTypegetFieldType(int type) Gets a known field type.getName()Gets the name.intgetSize()Gets the size.intgetType()Gets the type.abstract ObjectGets the value from a TIFF field.abstract byte[]Converts the given object to a byte array.
-
Field Details
-
BYTE
Byte field type. -
ASCII
ASCII field type. -
SHORT
Short field type. -
LONG
Long field type. -
RATIONAL
Rational field type. -
SBYTE
SByte field type. -
UNDEFINED
Undefined field type. -
SSHORT
SShort field type. -
SLONG
SLong field type. -
SRATIONAL
SRational field type. -
FLOAT
Float field type. -
DOUBLE
Double field type. -
IFD
IFD field type. -
LONG8
Long8 field type. -
SLONG8
SLong8 field type. -
IFD8
IFD8 field type. -
ANY
Unmodifiable List of all field types. -
SHORT_OR_LONG
Unmodifiable List of SHORT, LONG field types. -
SHORT_OR_RATIONAL
Unmodifiable List of SHORT, RATIONAL field types. -
SHORT_OR_LONG_OR_RATIONAL
Unmodifiable List of SHORT, LONG, RATIONAL field types. -
LONG_OR_SHORT
Unmodifiable List of SHORT, LONG field types. -
BYTE_OR_SHORT
Unmodifiable List of SHORT, BYTE field types. -
LONG_OR_IFD
Unmodifiable List of LONG, IFD field types. -
ASCII_OR_RATIONAL
Unmodifiable List of ASCII, RATIONAL field types. -
ASCII_OR_BYTE
Unmodifiable List of ASCII, BYTE field types.
-
-
Constructor Details
-
AbstractFieldType
Constructs a new instance.- Parameters:
type- the type.name- the name.elementSize- the element size.
-
-
Method Details
-
getFieldType
Gets a known field type.- Parameters:
type- the type to find.- Returns:
- the matching field type.
- Throws:
ImagingException- thrown when not found.
-
getName
Gets the name.- Returns:
- the name.
-
getSize
Gets the size.- Returns:
- the size.
-
getType
Gets the type.- Returns:
- the type.
-
getValue
Gets the value from a TIFF field.- Parameters:
entry- the TIFF field.- Returns:
- the value.
-
writeData
Converts the given object to a byte array.- Parameters:
obj- input.byteOrder- output byte order; not used by all subclasses.- Returns:
- a byte array.
- Throws:
ImagingException- Thrown on a bad input.
-