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 FieldTypeAscii
ASCII 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 FieldTypeByte
Byte field type.static final List
<AbstractFieldType> Unmodifiable List of SHORT, BYTE field types.static final FieldTypeDouble
Double field type.static final FieldTypeFloat
Float field type.static final FieldTypeLong
IFD field type.static final FieldTypeLong8
IFD8 field type.static final FieldTypeLong
Long 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 FieldTypeLong8
Long8 field type.static final FieldTypeRational
Rational field type.static final FieldTypeByte
SByte field type.static final FieldTypeShort
Short 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 FieldTypeLong
SLong field type.static final FieldTypeLong8
SLong8 field type.static final FieldTypeRational
SRational field type.static final FieldTypeShort
SShort field type.static final FieldTypeByte
Undefined field type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractFieldType
(int type, String name, int elementSize) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractFieldType
getFieldType
(int type) Gets a known field type.getName()
Gets the name.int
getSize()
Gets the size.int
getType()
Gets the type.abstract Object
Gets 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.
-