Class AbstractFieldType
- java.lang.Object
-
- org.apache.commons.imaging.formats.tiff.fieldtypes.AbstractFieldType
-
- Direct Known Subclasses:
FieldTypeAscii,FieldTypeByte,FieldTypeDouble,FieldTypeFloat,FieldTypeLong,FieldTypeLong8,FieldTypeRational,FieldTypeShort
public abstract class AbstractFieldType extends java.lang.ObjectTIFF field types.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<AbstractFieldType>ANYUnmodifiable List of all field types.static FieldTypeAsciiASCIIASCII field type.static java.util.List<AbstractFieldType>ASCII_OR_BYTEUnmodifiable List of ASCII, BYTE field types.static java.util.List<AbstractFieldType>ASCII_OR_RATIONALUnmodifiable List of ASCII, RATIONAL field types.static FieldTypeByteBYTEByte field type.static java.util.List<AbstractFieldType>BYTE_OR_SHORTUnmodifiable List of SHORT, BYTE field types.static FieldTypeDoubleDOUBLEDouble field type.private intelementSizestatic FieldTypeFloatFLOATFloat field type.static FieldTypeLongIFDIFD field type.static FieldTypeLong8IFD8IFD8 field type.static FieldTypeLongLONGLong field type.static java.util.List<AbstractFieldType>LONG_OR_IFDUnmodifiable List of LONG, IFD field types.static java.util.List<AbstractFieldType>LONG_OR_SHORTUnmodifiable List of SHORT, LONG field types.static FieldTypeLong8LONG8Long8 field type.private java.lang.Stringnamestatic FieldTypeRationalRATIONALRational field type.static FieldTypeByteSBYTESByte field type.static FieldTypeShortSHORTShort field type.static java.util.List<AbstractFieldType>SHORT_OR_LONGUnmodifiable List of SHORT, LONG field types.static java.util.List<AbstractFieldType>SHORT_OR_LONG_OR_RATIONALUnmodifiable List of SHORT, LONG, RATIONAL field types.static java.util.List<AbstractFieldType>SHORT_OR_RATIONALUnmodifiable List of SHORT, RATIONAL field types.static FieldTypeLongSLONGSLong field type.static FieldTypeLong8SLONG8SLong8 field type.static FieldTypeRationalSRATIONALSRational field type.static FieldTypeShortSSHORTSShort field type.private inttypestatic FieldTypeByteUNDEFINEDUndefined field type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFieldType(int type, java.lang.String name, int elementSize)Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static AbstractFieldTypegetFieldType(int type)Gets a known field type.java.lang.StringgetName()Gets the name.intgetSize()Gets the size.intgetType()Gets the type.abstract java.lang.ObjectgetValue(TiffField entry)Gets the value from a TIFF field.abstract byte[]writeData(java.lang.Object obj, java.nio.ByteOrder byteOrder)Converts the given object to a byte array.
-
-
-
Field Detail
-
BYTE
public static final FieldTypeByte BYTE
Byte field type.
-
ASCII
public static final FieldTypeAscii ASCII
ASCII field type.
-
SHORT
public static final FieldTypeShort SHORT
Short field type.
-
LONG
public static final FieldTypeLong LONG
Long field type.
-
RATIONAL
public static final FieldTypeRational RATIONAL
Rational field type.
-
SBYTE
public static final FieldTypeByte SBYTE
SByte field type.
-
UNDEFINED
public static final FieldTypeByte UNDEFINED
Undefined field type.
-
SSHORT
public static final FieldTypeShort SSHORT
SShort field type.
-
SLONG
public static final FieldTypeLong SLONG
SLong field type.
-
SRATIONAL
public static final FieldTypeRational SRATIONAL
SRational field type.
-
FLOAT
public static final FieldTypeFloat FLOAT
Float field type.
-
DOUBLE
public static final FieldTypeDouble DOUBLE
Double field type.
-
IFD
public static final FieldTypeLong IFD
IFD field type.
-
LONG8
public static final FieldTypeLong8 LONG8
Long8 field type.
-
SLONG8
public static final FieldTypeLong8 SLONG8
SLong8 field type.
-
IFD8
public static final FieldTypeLong8 IFD8
IFD8 field type.
-
ANY
public static final java.util.List<AbstractFieldType> ANY
Unmodifiable List of all field types.
-
SHORT_OR_LONG
public static final java.util.List<AbstractFieldType> SHORT_OR_LONG
Unmodifiable List of SHORT, LONG field types.
-
SHORT_OR_RATIONAL
public static final java.util.List<AbstractFieldType> SHORT_OR_RATIONAL
Unmodifiable List of SHORT, RATIONAL field types.
-
SHORT_OR_LONG_OR_RATIONAL
public static final java.util.List<AbstractFieldType> SHORT_OR_LONG_OR_RATIONAL
Unmodifiable List of SHORT, LONG, RATIONAL field types.
-
LONG_OR_SHORT
public static final java.util.List<AbstractFieldType> LONG_OR_SHORT
Unmodifiable List of SHORT, LONG field types.
-
BYTE_OR_SHORT
public static final java.util.List<AbstractFieldType> BYTE_OR_SHORT
Unmodifiable List of SHORT, BYTE field types.
-
LONG_OR_IFD
public static final java.util.List<AbstractFieldType> LONG_OR_IFD
Unmodifiable List of LONG, IFD field types.
-
ASCII_OR_RATIONAL
public static final java.util.List<AbstractFieldType> ASCII_OR_RATIONAL
Unmodifiable List of ASCII, RATIONAL field types.
-
ASCII_OR_BYTE
public static final java.util.List<AbstractFieldType> ASCII_OR_BYTE
Unmodifiable List of ASCII, BYTE field types.
-
type
private final int type
-
name
private final java.lang.String name
-
elementSize
private final int elementSize
-
-
Method Detail
-
getFieldType
public static AbstractFieldType getFieldType(int type) throws ImagingException
Gets a known field type.- Parameters:
type- the type to find.- Returns:
- the matching field type.
- Throws:
ImagingException- thrown when not found.
-
getName
public java.lang.String getName()
Gets the name.- Returns:
- the name.
-
getSize
public int getSize()
Gets the size.- Returns:
- the size.
-
getType
public int getType()
Gets the type.- Returns:
- the type.
-
getValue
public abstract java.lang.Object getValue(TiffField entry)
Gets the value from a TIFF field.- Parameters:
entry- the TIFF field.- Returns:
- the value.
-
writeData
public abstract byte[] writeData(java.lang.Object obj, java.nio.ByteOrder byteOrder) throws ImagingExceptionConverts 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.
-
-