public abstract class TiffField<T> extends java.lang.Object implements java.lang.Comparable<TiffField<?>>
We could have used a TiffTag enum as the first parameter of the constructor, but this
will not work with unknown tags of tag type TiffTag.UNKNOWN. In that case, we cannot
use the tag values to sort the fields or as keys for a hash map as used by IFD
.
Modifier and Type | Field and Description |
---|---|
protected T |
data |
protected int |
dataOffset |
protected static int |
MAX_STRING_REPR_LEN |
Constructor and Description |
---|
TiffField(short tag,
FieldType fieldType,
int length) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TiffField<?> that) |
T |
getData() |
int[] |
getDataAsLong()
Return an integer array representing TIFF long field
|
abstract java.lang.String |
getDataAsString() |
int |
getDataOffset()
Used to update field data when necessary.
|
int |
getLength() |
short |
getTag() |
FieldType |
getType() |
java.lang.String |
toString() |
int |
write(RandomAccessOutputStream os,
int toOffset) |
protected abstract int |
writeData(RandomAccessOutputStream os,
int toOffset) |
protected T data
protected static final int MAX_STRING_REPR_LEN
protected int dataOffset
public TiffField(short tag, FieldType fieldType, int length)
public int compareTo(TiffField<?> that)
compareTo
in interface java.lang.Comparable<TiffField<?>>
public T getData()
public int[] getDataAsLong()
public abstract java.lang.String getDataAsString()
public int getLength()
public int getDataOffset()
This method should be called only after the field has been written to the underlying RandomOutputStream.
public short getTag()
public FieldType getType()
public java.lang.String toString()
toString
in class java.lang.Object
public final int write(RandomAccessOutputStream os, int toOffset) throws java.io.IOException
java.io.IOException
protected abstract int writeData(RandomAccessOutputStream os, int toOffset) throws java.io.IOException
java.io.IOException